Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

231–240 of 856 posts

Re: Ask HN: Why did Python win?

#231

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.

My point was more that Ruby exploded because of a period when Rails was growing super fast. I don't know what the growth in RoR space is but I'm certain it's nowhere near what it was in late 2000s/early 2010s. And outside of that there's really not much in Ruby space.

Python was all over the place when RoR came out, meanwhile I only remember hearing about Ruby on random forum posts or by some enthusiast before RoR.

Re: Ask HN: Why did Python win?

#232
Reason is simple - Ruby is not good enough and lags in many, many, areas.

Ruby was an unknown till the RoR was introduced. And the reason why RoR was so easy and popular, was Ruby's biggest shortfall - excessive metaprogramming. The automated creation of all of the CRUD operations was definitely a kick in the... of Java and many other languages that lacked such ability. But that comes with all of the readability downsides, when "programming by convention" lacks a commonly understood convention. (Scala also suffers from it, just that Spark works so well for majority of it's use cases)

The worst part for Ruby, was that none of the features that RoR brought were hard to implement in other languages. Others caught up and Ruby didn't get enough windfall to keep sailing.

Then there was the community, that RoR attracted in the early days... the best way to describe it was - toxic.

> how fun and easy to use it is

First impressions are deceptive. When RoR was getting popular, many people who said the same typically showed me an example of some functionality implemented in just one line. Which is not exactly a great case for a programming language.

As for Python - it just grew steadily. Building the fundamentals and spreading. Having strong opinions from a single person made Python very easy to read and understand. It's by far the easiest popular language to use to demonstrate concepts to anyone - there's a very gentle learning curve. The community, tooling and documentation - are considerably better than Ruby's.

Remember that there are really beautiful expressive languages that make people fall in love with... but syntax is just one small part of it.

Re: Ask HN: Why did Python win?

#233

Earlier quoted context omitted.

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)…

>I think Python was popular as a general-purpose language first. What were their choices though, Perl? It's easy to see why Perl lost out. Other than PHP, I don't really know of any other JIT scripting languages they could have chosen.

There were always other choices. Lua is the main one that comes to mind.

The point is that data science use came quite late in the Python world, and the increase in users due to it is incremental. Python was already at 3.x before the ML world adopted it. If the ML world picked another language, Python would still be in the top 5 languages.

Re: Ask HN: Why did Python win?

#234
post #89

Python's old as dirt; it even predates Linux: https://en.wikipedia.org/wiki/History_of_Python Sometimes the key to success is to just be adequate for a really long time.

Well, Delphi is still adequate, but others got more popular.

Re: Ask HN: Why did Python win?

#235
post #103

Whilst the design of Ruby is far superior, Python has a wider range of data structures which may explain why it managed to gain a foothold in the scientific world. Both are multi-paradigm languages but procedural Python is also a little more idiomatic than its equivalent in Ruby which maybe makes Python easier for scientists who don't want to go all-in learning a more elegant language. Pretty soon in Python's rise it…

What about the design of Ruby makes it far superior?

Re: Ask HN: Why did Python win?

#236
Contrary to what many have said I think Ruby's popularity started to rise a bit before Rails. It got an earlier bump from being talked about in the 1999 Andrew Hunt and David Thomas book The Pragmatic Programmer.

As for why it beat our Ruby; in those early days Python tended to win the performance comparisons. That led to people using it for more demanding data tasks, which in turn led to more libraries for those sorts of domains. The parallel growth of jobs demanding those capabilities (data analytic and AI), cemented its supremacy.

That all said, if I need to hack a script together to automate some development task - in the vein of what Hunt and Thomas described back in 1999, I still reach for Ruby.

Re: Ask HN: Why did Python win?

#237
I am one of the likely millions of people that got sucked into python for its accessibility and powerful data manipulation libraries. Granted I started in the mid aughts with web scraping and other stupid endeavours. That user base growing out of matplotlib/numpy later pandas at a time when data literacy got more important is I think the major driver of its success now.

Also does not hurt that it was designed as a teaching language at first. Nowadays reading some of the code that is out there I feel like I have no idea what is going on. Type hints and that way some libraries use it makes my head spin sometimes...

Re: Ask HN: Why did Python win?

#238

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.

10 ish years ago, pretty much all new hip HN startups plus existing success stories all started in Ruby on Rails, or feels like they did anyway.

Re: Ask HN: Why did Python win?

#239

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

As evidenced by the unified Python library / dependency management system.

I use pip 100% of the time

Re: Ask HN: Why did Python win?

#240
The ecosystem created an echo-system.

Being default on linux helped python succeed, not anything specific about the language. It became default on Linux because it was better than perl or bash (easier to use and manage deps) and had decent upstream support and an ecosystem around since the 90s.

On windows powershell is still king, python shares the throne as a close second though. Compare all that import-module, nuget, winget, chocolatey,etc... mess with pip! And version nightmares are more manageable thanks to pyenv. Python ecosystem is good at making a mess work well (except when it doesn't).

Post reply on HN