Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

411–420 of 856 posts

Re: Ask HN: Why did Python win?

#411
post #284

Earlier quoted context omitted.

> Python is not the best language for any particular task Python basically solved this problem by wrapping around C code that's far more performant, but still exceptionally simple to leverage due to python's simple syntax. LlamaCpp has C++ in its name, yet its most popular platform is python. So for certain applications, python because the undisputed #1. Because it was C in disguise, with better usability. With paral…

> Python basically solved this problem by wrapping around C code I would rather call it a work-around. Having to switch to a vastly different language to get halfway decent performance is hardly a good solution. It's not a rare thing in normal applications that you need to have some routine fast and there's no pre-built C solution for it.

It is not hard to write C. It is hard to write large safe multi-developer C programs with complex object lifetimes. But if you are just writing an inner loop in a CPython extension it is easy.

Re: Ask HN: Why did Python win?

#413

Earlier quoted context omitted.

> But Python is -dramatically- better focused, as a community, on finding a Pythonic way to proceed, and then advocating it, than previous cultures. I would revise that to be that the pythonic culture of one acceptable way to to is better matched with a lot of good development practices. Perl was also very good at finding a Perl way to proceed. It's just that with Perl that often mean a lot of implicitness and "do wh…

Not just practices, tooling. The whole typing system. Linting to check for mistakes. For the love of black.

Python's static typing still feels very very clunky and bolted on, and tooling around it was rather bad, like mypy. In general I definitely wouldn't say python tooling was good. It's improving rapidly with ruff tho, just as JavaScript when esbuild appeared.

Re: Ask HN: Why did Python win?

#414

Earlier quoted context omitted.

So I imagine you have that perspective because you started less than 20 years ago. In some ways the idea of the Pythonic Way to do things evolved in opposition to Perl's vigorous advocacy of More Than One Way. Python has been really winning for some time, so it's natural that its ideological discipline has grown ragged. The crop of kids who value options above consistency don't have the scars of the Perl age to infor…

+1 for mentioning that python's original competitor was Perl. This point is forgotten some 20-30 years latter

Not just perl, but C/C++/Java as well. Ruby was a competitor to Java JSP development back in the day. And I remember when a lot of Java people jumped ship to Ruby. I moved from C++ to python over a decade ago and never looked back.

Back then, the python jobs were scarce -- but based upon how I picked up the language, many of the typical C++ issues just disappeared -- and I knew it was going to become popular.

One comp sci professor talking at a PyCon years ago made a point that maybe the best college level introductory course probably should not have been SICP based but Python. His example was that for the first time in 5 years of teaching intro courses he had people coming up to him looking to change majors.

Re: Ask HN: Why did Python win?

#415
post #326

Earlier quoted context omitted.

>> I use pip 100% of the time What about pipenv, poetry, conda, setuptools, hatch, micropipenv, PDM, pip-tools, ActiveState platform, homebrew, or your Linux / BSD distro's package manager?

As much as I love to rag on things, I would go so far as to say that the big problem with Python packaging is the fact that it tries to manage C/C++ packaging and integration. If Python is only managing Python code, the issues to be solved are VASTLY simpler. Just about anything works. Once it has to deal with dynamic libraries, compiled code, plugins, build systems, etc. the combinatorial explosion just makes life s…

Python is a victim of its own success and versatility.

It has become a better "glue code to solve your problem" than many other solutions and so people want to use it everywhere for everything.

It gets packaged in many different ways because it gets used in many different ways for many different purposes.

Re: Ask HN: Why did Python win?

#416

Earlier quoted context omitted.

> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though

Whatever in the NamedTuples do you mean?

There is also TypedDict, Pydantic, Attrs and dataclasses

Re: Ask HN: Why did Python win?

#417

The way I (somewhat hazily) remember it, Python was mainly competing with Perl as a scripting language, not Ruby as an application/web language. I started hearing about Ruby years later when Ruby on Rails drove the Web 2.0 movement, but that feels like a different era to me. Eric S. Raymond wrote an article[1] in 2000 about his experience trying Python after spending a lot of time with Perl. I'll quote some of it her…

This is an accurate explanation.

I started to teach myself Python just before 2000.

The general consensus before then was that for a first language Perl or Python would be a good choice. Python was typically preferred because it was more approachable than Perl i.e more succinct.

With no prior programming experience (besides manually typing out programs into my C64 as a kid) I managed to build a program that connected to my webpage hosted by my ISP and changed a link in a page to point to a web-server I was running on my PC by just referring to the standard documentation.

That’s one point that doesn’t get mentioned I think. The standard documentation was clear and accessible in a variety of formats. Also Python on Windows was very easy to set up.

Re: Ask HN: Why did Python win?

#418

Can I quote zach's 15 year old comment on Python vs Ruby? Maybe it will have some relevant insights: > Ruby has clever syntax. Python has pure syntax. > Ruby has method aliases. Python does not allow a string to capitalize itself. > Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function. > Ruby ha…

I wish I could favorite comments. Thanks for sharing this one.

Re: Ask HN: Why did Python win?

#419

Can I quote zach's 15 year old comment on Python vs Ruby? Maybe it will have some relevant insights: > Ruby has clever syntax. Python has pure syntax. > Ruby has method aliases. Python does not allow a string to capitalize itself. > Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function. > Ruby ha…

I wish I could favorite comments. Thanks for sharing this one.

Click the time on a comment ("1 hour ago", "60 days ago", etc), that will focus you on the single comment and give you the option to mark it a favorite. You can access your favorites through your HN profile.

Re: Ask HN: Why did Python win?

#420

Earlier quoted context omitted.

So I imagine you have that perspective because you started less than 20 years ago. In some ways the idea of the Pythonic Way to do things evolved in opposition to Perl's vigorous advocacy of More Than One Way. Python has been really winning for some time, so it's natural that its ideological discipline has grown ragged. The crop of kids who value options above consistency don't have the scars of the Perl age to infor…

Back when I decided it was time to add a scripting language, Perl and Python seemed like the obvious choices, and in my mind were equally good options. I asked my best friend which I should choose, and he more or less said, "You can't go wrong with either one, but when you ask for help Perl people are assholes and Python people are nice." I can't confirm his thoughts on Perl and I haven't interacted much with Ruby, b…

Oh I have met Ruby people and it's a big factor in why I never learnt the language.
Post reply on HN