Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

251–260 of 856 posts

Re: Ask HN: Why did Python win?

#251

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…

I think Python was popular as a general-purpose language first. After all, there was a reason people put so much effort into writing Numpy in the first place. I think a lot of people were attracted to the language design, as captured in the Zen of Python ( https://peps.python.org/pep-0020/ ), such as: Explicit is better than implicit. Readability counts. Errors should never pass silently (unless explicitly silenced)…

There are just too many ways to do things in Ruby. How many forms for an if-else or for loopin can you name in Ruby? Just as the simplest example.

Monkeypatching is also awful for readability.

Explicit imports are way more readable than things appearing into current namespace implicit kind of stuff like it happens with Ruby

Re: Ask HN: Why did Python win?

#252

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…

> Ruby relied only on web development Chef, Puppet, Vagrant, Logstash, etc are not web development. Ruby dominated (dominates?) DevOps tooling.

Ansible is Python, Terraform is Go. Those are 2 giant projects in DevOps.

Re: Ask HN: Why did Python win?

#253
post #249

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

There's generally one obvious way to do it. There's almost certainly other ways to do it, and those other ways might be better suited for different specific tasks, but the obvious way tends to exist and be widely usable. Are there some exceptions? Sure.

I'd suggest "pythonic", rather than obvious, for that sentence. It's one of the ways the community reminds itself of the utility of consistent discipline.

Re: Ask HN: Why did Python win?

#254
A lot of people who picked up Python, especially in the 1990s, picked it up as a side language. They were doing "serious" programming in C or C++, and they needed another powerful, potentially cryptic language like they needed a hole in the head.

I believe that Python gained popularity among scientists for the same reason. They needed a simple programming language, not because they lacked brainpower, but because their job was to focus their intelligence on the scientific problems they were solving, not on programming. Writing code was necessary but not meaningful in itself, like washing beakers or feeding lab rats. The less effort it took, the better.

For people like that, Python won because they were able to become productive with it while learning very little about it. Also, it was rare to accidentally write Python code that was hard to read. This was especially important for scientists, who didn't have a software engineer's appreciation of the difficulty of reading code and the need to practice restraint when writing it.

Re: Ask HN: Why did Python win?

#255
Well, for one thing, the versions of ruby were sloow, like an order of magnitude slower than python at the time. It didn’t even have a JIT - it was pure interpretation - if you went through a loop 10 times, the code inside got parsed 10 times.

Also, python predated ruby by several years. Python 1.5.2, which is about the earliest version that resembles modern Python, was release in early 1998. The first Dnglish language book on Ruby didn’t come out until late 2000.

Re: Ask HN: Why did Python win?

#256

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…

I think that data science & web competition is at least 80% but I'm going to throw out a few possible ideas that I haven't seen mentioned that may have helped. Maybe I'm way off base though.

* Udacity's popularity. It's first few free courses were Python. I believe they advertised as a way to get into Google. Not sure how many people got into Google via Udacity though.

* Leet Code Job Interviews. Maybe I'm way off here as I don't do these but from what I've read people who spend a lot of time on these prefer Python because the syntax & libraries often give a speed & simplicity advantage.

* Lots of devs had to install Python to use some utility or tool someone else created.

Re: Ask HN: Why did Python win?

#257
post #249

Earlier quoted context omitted.

There's generally one obvious way to do it. There's almost certainly other ways to do it, and those other ways might be better suited for different specific tasks, but the obvious way tends to exist and be widely usable. Are there some exceptions? Sure.

I'd suggest "pythonic", rather than obvious, for that sentence. It's one of the ways the community reminds itself of the utility of consistent discipline.

It's perhaps worth noting that the next line of the Zen of Python is: "Although that way may not be obvious at first unless you're Dutch." (I.e. unless you're Guido.)

So it was a bit of a tongue in cheek statement from the very beginning. :D

Re: Ask HN: Why did Python win?

#259

Ruby was never similar in popularity to Python. It was just a fad in webdev circles. I've rarely seen ruby before RoR and I've seen python all over. Python was popular as a teaching language, how it gained a foothold in academia. I remember 20 years ago when I was starting out it was popular for game scripting (Lua was more embeddable but python was also used). plenty of first class interfacing methods to native code…

I'll bite on "just a fad in webdev circles", in case you are serious and not trolling. Railsworld is celebrating the 20th anniversary of Rails this year. As I'm sure you know, Rails is built on Ruby. 20 years does not fit my definition of fad.

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.

Re: Ask HN: Why did Python win?

#260
Going meta: I haven't read a HN thread in years that I agreed more with for almost every single comment. Incredible niche breakdown of the mess of factors that drove happenstance to circumstance. No ideology, just learned on the ground experience. More of this?
Post reply on HN