(It’s not so pretty these days though with all these type hints and other cruft that’s been added in the last ten years.)
Ask HN: Why Did Python Win?
51–60 of 162 posts
Re: Ask HN: Why Did Python Win?
#52I think there's a few key features for python that have definitely been a big help for it:
It's highly dynamic meaning you can get running with it before understanding every detail (no compile step, no static typing etc).
It may not be the best at everything, but is a decent choice for most things, making a good generic intro language for programming.
It has good interop with low level languages - this is a big deal for data science where a less technical (from a CS perspective) user still needs the performance of a language like C/Fortran/Rust/etc. Python's pattern of "use python as a high level api for libraries in those other languages" (as in numpy, pandas, polars, pytorch etc).
That last one has been a big deal recently, python has become the de-facto language for data science as a result of this.
Re: Ask HN: Why Did Python Win?
#53Re: Ask HN: Why Did Python Win?
#54Its 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.
Re: Ask HN: Why Did Python Win?
#55I 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 don't believe the "syntax win" scenario. Python is also ugly, due to the required indentation, like yaml. I believe more in the ecosystem, specifically how the computer vision and machine learning movements have adopted python extensively as frontend language (the heavy weightlifting is still doing in C++). The exploit of numpy has brought many many use cases into the language as well.
Re: Ask HN: Why Did Python Win?
#56Re: Ask HN: Why Did Python Win?
#57python won because of enforced whitespace. It solved a social problem that other languages punted to linters, baking readability into the spec
Re: Ask HN: Why Did Python Win?
#58Re: Ask HN: Why Did Python Win?
#59Re: Ask HN: Why Did Python Win?
#60It felt pretty easy to read and write, had minimal surprises, and it made writing simple programs easy. The batteries-includedness was great.
It felt like it was designed by a smart guy for practical programming, rather than by a brilliant academic who was wed to purity for maximum elegance. It accepted some warts, but them in mostly ergonomic places.
It was dictated by people who could relegate map, filter, and reduce from builtins to the library. As much as I personally even liked map in particular (I am not super anti functional programming), it's nice to realize the designer had the taste to prefer longer but more explicit programs.
ys = [f(x) for x in xs]
ys = map(f, xs)
As much as I disliked that particular decision, there is no doubt to me that it is just designed for lower cognitive burden when doing simple/common things.If you show both of those lines of code to a person in cs101 who has studied Java for a couple months but hasn't seen Python, I am pretty sure they are gonna understand the first line way quicker. Mostly consistent decision making like that leads to ergonomic, practical languages. And they win.
It fits in people's brains better. See also, pytorch vs tensorflow.