Ask HN: Why Did Python Win?

53 points by fud101 ↗ HN
I was listening to an old postcast from 2021 which discusses the inexplicable rise of Python.

I remember much of the positive sentiment around Python in the early days being less about Python and more about how powerful Perl is but Perl is Perl. Python being the nice and clean version of Perl meant it got all all the praise of Perl while enjoying the reputation of having none of the failings of Perl. In hindsight I think Python needed to stand on its own right, not just as a better Perl, but yet here we are. I think hindsight will show we should have considered the defects of Python more deeply. I know the lispers saw them but no one listens to them. Today Python is most dominant language on the planet and Perl is all but forgotten.

If you survey the language landscape now, a language can be much better than Python but never get the chance Python did just because it happened to look a bit better than Perl. Which is absurd to me.

71 comments

[ 4.0 ms ] story [ 62.8 ms ] thread
python won because of enforced whitespace. It solved a social problem that other languages punted to linters, baking readability into the spec
First class package manager, first class numeric operations for scientific usages (numpy), garbage collection, uniform human-readable syntax. Basically seems like it learned a lot from Perl both good and bad, and put those lessons into usage with the scientific community first. Kids got used to it in school and wanted to use it after.
Did it win? Against just Perl, or everything else?
No surprise that interpreted languages like Javascript, Perl, PHP and Python are disproportionately popular independent of pure language merit. The feedback loop is the killer feature.
I think the reason python won was that it was easy to learn and read and was batteries included. vs perl: People need to solve their problems, not fight with syntax

Theres a lot of network effects as well. The more people were using it, the more people will use it.

>>I think the reason python won was that it was easy to learn and read and was batteries included.

This is also a big reason why AI assisted programming will wholesale replace Python programmers.

If your are optimising for people who wish to remain at beginner levels all life, and that replaced people using power tools to solve harder and bigger problems. It shouldn't be surprising that now some automation will replace you.

pytorch, langchain, streamlit, fastapi, and on and on ...

There are many clear reasons imo.

> Python is most dominant language on the planet

JavaScript would like a word!

Personally, I do not think there is a language in the ALGOL family tree with better syntax than Python. It removes just about all the BS: ceremony, boilerplate, curly braces, etc. Oftentimes as programmers we write out ideas as pseudocode... and that pseudocode is oftentimes coincidentally valid Python! I think this is a critical reason why Python has been so successful. It's simple and powerful at the same time.
Its syntax is lowest common denominator. It’s incredibly easy for people from all walks of life to pick up. It’s “good enough” for just about every task.

But really it’s because Google, Dropbox, etc made it so. Same reason Java got popular. It’s hard to beat first class corpo support even if the actual language isn’t that great.

There is a network effect with programming languages. Once you get popular, more people write libraries and guides for that language, which in turn makes it even more popular.

If you were czar of the universe and could start from scratch, could a better scripting language be created? Sure. But that’s not the fact pattern, and Python isn’t bad enough at what it does to warrant starting over.

So much easier to pick up than Perl. Even for an experienced programmer, let alone a new learner. And the rich standard library.
You can't only look at it from the perspective of a software engineer. Ordinary people can read and write Python much more easily than a ton of other languages. It's very easy to get started, with basically no ceremony. Highly tolerant of user errors yet still allows one to grow with the language (nobody writes ABCs on their first day).

Python has issues, but those issues don't matter equally to everyone and every use case. Low barrier to entry, coupled with Metcalfe's law, explains a lot IMO.

I love Scheme, but not everybody does, and I can see why.

> it happened to look a bit better than Perl. Which is absurd to me.

It's not absurd, it's a debatable point. I think being easy to read is definitely a desirable quality for any language, especially for adoption. Some are better than others in this field.

Previously:

- Perl's decline was cultural - https://news.ycombinator.com/item?id=46175112 - Dec 2025 (460 comments)

- (!) Ask HN: Why did Python win? - https://news.ycombinator.com/item?id=37308747 - Aug 2023 (839 comments)

- Ask HN: Why is Python so popular for ML/DS? - https://news.ycombinator.com/item?id=16207834 - Jan 2018 (19 comments)

- Ask HN: Is Python dying? - https://news.ycombinator.com/item?id=11100251 - Feb 2016 (352 comments)

- Python is now the most popular introductory language at top U.S. universities - https://news.ycombinator.com/item?id=8001337 - July 2014 (362 comments)

- Ask HN: Why Python over Ruby? - https://news.ycombinator.com/item?id=682101 - July 2009 (196 comments)

- Ask HN: What does Ruby have that Python doesn't? - https://news.ycombinator.com/item?id=283639 - Aug 2008 (223 comments)

Hopefully RAM prices continue to increase so that we are forced to rediscover the lost art of software efficiency and optimisation.
Because it's really enjoyable to use. If you are doing something where you can use Python, ie. you can afford the performance hit, it's hard to find reasons to not like it. Common Lisp has it all, but for some reason people can't cope with the parens. People just genuinely enjoy using Python.
Non-swe, classic engineer here

Python is easy to learn and has an extensive library catalog. It also has massive support available online. That's why I have chosen it in the past when I needed to write basic programs for work.

With the rise of LLMs, python is now even more attractive as LLMs really excel at writing it.

Python optimized for C-interop (NumPy) just as data science exploded. While Perl won text processing, Python became the universal interface for C libraries. That ecosystem lock-in—not syntax—is why it won. It was the right glue at the right time.
Python was viewed as an alternative to Perl mainly because they were used for the same kinds of scripts. The biggest difference at the time, how-many-ways-to-do-it notwithstanding, was that when a novice saw a Python script of 20-50 lines, they (felt like they) understood it without having to reach for a language reference. Readability at a glance for people who hadn't yet specifically learned the language was huge. "Executable pseudocode" was the operative phrase.
Years ago I wrote article on this topic: https://www.notonlycode.org/why-python-has-won/

In short (all below is my opinion): it was popular in academia and got some corporate adoption, so when ML exploded in popularity it was a natural choice as the scripting language for ML tooling. On top of that it’s easy to pick up as a language, and it’s a general purpose language - there are lots of scientific tools like pandas written in it, there are web frameworks, etc.

Perl was too quirky for wide adoption and it stopped developing (Raku/Perl 6 took to long to develop), PHP was focused purely on the web, similarly JS. Ruby could have won, I like it more than Python, but outside of Japan it’s also mostly been associated with web development (because of Rails), it also lacked libraries that Python already had.

Win what?

Against Perl? Over a decade ago. 10 years ago, the only places that required Perl were either hard engineering (i.e. non-programmer EEs) or those with legacy code bases.

Over everything else? Of course not. You don't do systems level work in Python.

The problems with Python are minor (other than packaging), and not a big enough pain to adopt another language. If you really could benefit from static typing, there are already existing languages that do the job well (C++, Rust, etc).

For the majority (including even some Perl fans), switching to Python was a significantly better experience. If you now show me a language better than Python, it's really only an incremental benefit. Sure, I prefer ML languages like F#, but the vast majority don't.

> If you survey the language landscape now, a language can be much better than Python but never get the chance Python did just because it happened to look a bit better than Perl. Which is absurd to me.

You’re struggling to understand Python’s success because in your head the primary reason Python succeeded was because it happened to be prettier than Perl, and you can’t wrap your head around why that’s enough. But it’s not enough. Python succeeded for many reasons.

I have recently gone all in on Python. Before I decided this, I was using Python for projects where I needed Pandas or numpy. I used React/TypeScript/Node for web applications. But, I moved to Django/HTMX.

The main reason is to avoid npm, but also, I wanted something with more built-in defaults (my web apps have simple needs). It has nothing to do with the language -- it's more the ecosystem for me.

I considered Ruby/Rails, but it didn't seem enough better than Python and can't replace the Pandas work I need to do.