Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

481–490 of 856 posts

Re: Ask HN: Why did Python win?

#481

Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors. Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web…

And this was all despite Python 3 which was, imo, the worst software migration in history

Re: Ask HN: Why did Python win?

#482
post #414

Earlier quoted context omitted.

+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 com…

C++ and Python are not competitors. Sure both are Turing complete so you can implement anything in either. However if you should is a different question. Python is very difficult to maintain when you program goes over 100k lines of code, while the static type system of c++ is good for millions. C++ compiles to fast binary code, while Python is typically 60x slower for logic (though often Python calls a fast algorithm implemented in a compiled language for anything significant so this is hard to measure in typical programs). However if your programs are not very large and you don't need every last bit of speed Python is going to be easier to work with. (And frankly if not working with a legacy c++ codebase you should look at rust, ada, go, or something else i'm not aware of, c++ has many ugly warts that you shouldn't need to worry about)

Re: Ask HN: Why did Python win?

#483
post #329

Earlier quoted context omitted.

I like Python, but most of the Zen has always been a meme, and not a guideline of design principles of either the language, or software written with it. Besides the one you mention, I also find the "Explicit is better than implicit" line to be against everything Python stands for. The language is chock full of implicit behavior, and strongly encourages writing implicit code. From the dynamically typed nature of the l…

It is absolutely not a meme, it's [PEP 20]( https://peps.python.org/pep-0020/ ). Just because some people don't take it seriously, it's definitely a part of the language's soul.

I think The Zen was really important for Python's success as well. Having your core values right there, well defined and out in front, wasn't something you get with a lot of languages. Any language thats been around for a long time gets sorta.. muddled.

Re: Ask HN: Why did Python win?

#484

Earlier quoted context omitted.

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.

Dumb question: I know the built-in typing (import typing) is limited in some ways, but it works pretty fine to cover most basic needs. So what does mypy add? I'm super interested in adding typing to some code we have but I'm just a bit confused by the choices available.

Would mypy with pydantic be a good combination or do they overlap?

Re: Ask HN: Why did Python win?

#485

Earlier quoted context omitted.

Just because there are people who still use it, doesn't make the statement that RoR was a fad less true. RoR was "the thing that everyone was using" at one point. It was that for several years. Anyone who's anyone was building stuff with Rails. Now it's probably the third option, when building websites... and a fourth option, when building APIs.

fad - an intense and widely shared enthusiasm for something, especially one that is short-lived and without basis in the object's qualities; a craze. --- I don't think Ruby is a fad. The drop off Ruby had since early 2010s is dramatic, but it stabilized around 5% of all PRs on GH in the last few years: https://madnight.github.io/githut/#/pull_requests/2023/2 It's still one of the most popular languages for web develo…

> It's still one of the most popular languages for web development.

But is it? Stats on major job boards such as Indeed show a steep decline in recent years. There are consistently twice as many Django/Flask roles listed compared with Rails. Node is the most popular but Spring, ASP.Net and PHP occupy the next level below Node.

Re: Ask HN: Why did Python win?

#486

Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors. Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web…

Ruby is also kind of horrible.

Re: Ask HN: Why did Python win?

#487

Earlier quoted context omitted.

Just because there are people who still use it, doesn't make the statement that RoR was a fad less true. RoR was "the thing that everyone was using" at one point. It was that for several years. Anyone who's anyone was building stuff with Rails. Now it's probably the third option, when building websites... and a fourth option, when building APIs.

fad - an intense and widely shared enthusiasm for something, especially one that is short-lived and without basis in the object's qualities; a craze. --- I don't think Ruby is a fad. The drop off Ruby had since early 2010s is dramatic, but it stabilized around 5% of all PRs on GH in the last few years: https://madnight.github.io/githut/#/pull_requests/2023/2 It's still one of the most popular languages for web develo…

Thanks for linking that graph. I wonder to what extent Ruby’s decline as a percentage is due to its use declining versus other languages growing.

Re: Ask HN: Why did Python win?

#488
post #78

Python grew out of a myriad of applications that built on hard to replicate components, while Ruby relied only on web development which is remarkably subject to fashion. Python is very simple making it easy to learn. Thus, it became more and more popular for fields where programming is not the main task, like science. It is also very easy to extend with C. So, these fields could bolt on time-tested scientific code in…

> Python is very simple making it easy to learn. I would argue that there's little difference between them in ease of learning. I personally found Ruby easier because everything being an object with methods and no free floating functions felt more natural and easier to look up. i.e. string.length over Python len(string)

The global functions throw me off too.

To me in general Ruby is the nicer feeling of the two, just generally more "friendly" and "human". Whether those are desirable traits of a language is up for debate but I think there could stand to be more language with such a flavor.

Re: Ask HN: Why did Python win?

#489
post #326

Earlier quoted context omitted.

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.

Packaging is a difficult problem and all attempts to simplify things fail to understand how complex the problem is and so fail in some way. (Attempts like .deb do okay by only focusing on a subset of the problem)

Re: Ask HN: Why did Python win?

#490

Earlier quoted context omitted.

I see what you mean, but I counter with Plone. It's been around for 24 years, and the annual Plone Conference is coming up in a couple months. Still, you don't see a whole lot of new Plone sites rolling out these days, and there's no Automattic-scale company with click-here-to-deploy convenience. Nothing against Plone (although I was very happy to put its foundation layer, Zope, in my rear view mirror). It's a fine p…

Plone never had anything even resembling Rails' popularity.

So true. Still, you can't judge that from how long it's been around.
Post reply on HN