Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

601–610 of 856 posts

Re: Ask HN: Why did Python win?

#601

Back when I read the O'Reilly book on Ruby on Rails, it liberally referred to "Why's Poignant Guide to Ruby." That's when I realized something: The book, and thus Ruby on Rails, appealed to teenagers as their first programming language. Teenagers get very passionate about things, and emotionally involved with their choices. Python is a tool. Good tools are boring, and don't come with references to bacon and other gra…

I don't think your hunch here works.

Why wasn't a teenager when they wrote that book. The Ruby community had very few teenagers involved when Rails was released.

The Ruby and Rails communities did do a great job of attracting passionate, creative people. Those people weren't teenagers.

Re: Ask HN: Why did Python win?

#602
post #465
post #366

Earlier quoted context omitted.

But Ruby took all the best bits of Perl so I'm still perplexed as to why Python "won".

Because the best bits of Perl were kinda trash that Python was smart to avoid.

Yeah for sure, the PERL influence is why I dislike Ruby. Makes it really hard to read if you haven't been doing it constantly.

Re: Ask HN: Why did Python win?

#603
I look at it in the following way:

- Ruby and Rails are joined at the hip in a way that Python isn't. While Ruby is a general purpose language, it was only strongly adopted by web developers.

- Rails didn't have a competent deployment story initially. It was a pain to deploy and run mongrel relative to other platforms and this only seemed to get effort after the first RailsConf. The impact of this was primarily on enterprise developers who might have gotten adoption to a higher level.

- Speaking of the first RailsConf, DHH did everything possible to undermine potential advocates within the enterprise space where lots of Java refugees might have helped with adoption. ThoughtWorks backed Ruby and Rails, but there are quotes from Martin Fowler like:

"A couple of years ago I wrote about the impressions people had that the RubyPeople were notably more friendly than most software communities. Talking to people at RailsConf I got the message that that had changed for the worse. Both the ruby lists and particularly the rails lists had tended more towards the sad Internet mean. In his opening keynote Chad Fowler said that the rails community had a reputation as "a bunch of arrogant bastards" and I cringed as an, admittedly small, group raised a triumphant cheer." (https://martinfowler.com/bliki/RailsConf2007.html)

- The community was very anti-Windows which stifled adoption. The default developer machine now seems like a MBP, but it wasn't in 2007. Rails got lots of attention around the time of the Intel transition so this was a cool time to have a Mac. A PC was only usable for Rails work if you put Linux on it. Some people realized you needed better basic Windows support to run Rails for development, but it wasn't a priority. Again, this limited potential web adoption.

From this you can see a repeated pattern of mistakes which would have at least increased Rails use in the enterprise market. It was strongly adopted in startups and niches within enterprise that IT didn't control. There was no real reason to discourage this community of developers who found Rails a nice fit for what they were building.

Now Python:

- The Python community specifically targeted diversity and getting adoption in first programming classes in colleges. This was an active effort that accelerated things at least as much as use in data science. The fact that everyone was being taught Python as a first language even if they'd go the web route was a huge boon to cement it within the data science perspective.

- In the previous point I called out diversity because it was a key differentiator in getting it everywhere. Not everyone stayed in the community, but they stayed at a higher rate than Ruby. People will want to discount this because they feel it's political or woke, but it affects the TAM. I don't think you can substitute "friendly" because they knew that wasn't sufficient.

- Python has had stronger Windows support. The effort was inconsistent over time, but it existed and wasn't discouraged to the degree that it was for Ruby. Companies like Active State where popular long before Anaconda appeared on the scene.

- Packaging in Python is a disaster zone, but it's been good enough to get adoption.

- Google gave credibility to Python at a time when it was competing with Python. This swayed non-devs in decision-making roles to an extent. Importantly, Python hasn't been wed to one vendor. When Google dropped, other stepped into the fray. It seems MS are quite involved today.

- The transition from Python 2 to 3 is viewed as a misadventure by many. It did this and still won out. If you rewind to PyCon 2009/2010, the vision shared by Guido was for a long term transition with some degree of experimentation. People have forgotten, or joined late.

- Data scientists have taken over the Python community, but Django and Flask are still pretty sizeable communities. This diversity is a strength and the community is open to experimentation.

- Python performance doesn't suck much more than Ruby for the most part. If Python had disadvantages to a peer like Ruby, it may have had an impact. Instead, people inside the community complain and stay, or they peel off to Go/Rust/C#/Java/Kotlin (any faster platform) at a slower rate than you might expect. Yes, whole teams/apps drop it wholesale, but what matter is the overall number. I think this is more of a concern today (like packaging is) than it was in the key period of 2006-2012 when the battle was fought.

Re: Ask HN: Why did Python win?

#604
If you think about it from the perspective of people learning programming, python is dead dead simple. In Unix like systems it comes preinstalled most of the time. For so many students in many parts of the world who use an HP/Lenovo laptop for university work the OS is windows and python installation is again, dead dead simple.

Ruby starts off by saying you should have a version manager. And windows installation is not straightforward (from a student perspective it’s important to note that something that looks like it isn’t officially supported makes it feels like the entire language is going to be a compatibility slog). This is not dead dead simple. It’s not hard. But it requires more than one concept to be learned to start.

Then the docs. Ruby has so many ways of getting started. Python puts up one main way. Same for the api reference. Python has a single link and they even say “keep this under your pillow”. As a beginner I know what I should do. Ruby? Many links that say arcane stuff (beginner perspective) like rdoc and what not. Python is super clear in their breakdown of reference too. I cannot stress enough how simple this page (https://docs.python.org/3/library/index.html) makes it to find what you want.

Overall Ruby and it’s documentation feels like it’s made for people who know Ruby or something more than the bare minimum. Python is made for people who’ll be trying out programming itself for the first time.

To me, that’s what made Python win. They just seemed like they thought more about folks starting out for the first time.

Re: Ask HN: Why did Python win?

#605

Earlier quoted context omitted.

For me, the Ruby community's comfort with monkey patching was a big turn off. In Python, you can hack around on class and replace its methods, but if you do, it's expected that your coworkers might stick you in a dunk tank and sell tickets. It's just not the thing that's done.

For me, the Ruby community's comfort with monkey patching was a big turn off If it helps, the Ruby community really soured on monkeypatching in general quite a while back. You don't see it much these days and every decent book or guide warns against it. It was definitely a crazier place 10+ years ago in the early Rails days.

>It was definitely a crazier place 10+ years ago in the early Rails days.

Yeah! It sure was.

I was around, was an early Ruby and Rails adopter, and worked on a few commercial Rails projects at that time.

That's how I know about the monkey patching issues. Faced them in real life.

Re: Ask HN: Why did Python win?

#606

Earlier quoted context omitted.

For me, the Ruby community's comfort with monkey patching was a big turn off. In Python, you can hack around on class and replace its methods, but if you do, it's expected that your coworkers might stick you in a dunk tank and sell tickets. It's just not the thing that's done.

Whereas in Ruby you get to go to a conf for doing that.

Downvoter(s):

https://news.ycombinator.com/item?id=37316817

Re: Ask HN: Why did Python win?

#607

Earlier quoted context omitted.

That’s any code I haven’t looked at for a while, to be honest. I can’t count how many times I’ve looked at code I wrote or bug tickets I fixed and have absolutely no memory of doing it. It’s almost like the act of committing flushes the local storage in my brain.

I run into this problem as well I'll often come across something I wrote a few years ago and struggle to remember why I wrote it that way. I've learned to add comments to my code - from what I see commenting code is frowned upon by a certain subset of developers but I've taught myself that whenever I am doing something subtle or unintuitive to add a short comment explaining what the code is doing, for every potential…

[deleted]

Re: Ask HN: Why did Python win?

#608

Earlier quoted context omitted.

I run into this problem as well I'll often come across something I wrote a few years ago and struggle to remember why I wrote it that way. I've learned to add comments to my code - from what I see commenting code is frowned upon by a certain subset of developers but I've taught myself that whenever I am doing something subtle or unintuitive to add a short comment explaining what the code is doing, for every potential…

> from what I see commenting code is frowned upon by a certain subset of developers I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a... belief.

The main argument seems to be comments should left with the commit message and not "inline" i.e mixed with the code. Personally I make heavy use of inline style comments.

Re: Ask HN: Why did Python win?

#609
post #228

Earlier quoted context omitted.

For me, the Ruby community's comfort with monkey patching was a big turn off. In Python, you can hack around on class and replace its methods, but if you do, it's expected that your coworkers might stick you in a dunk tank and sell tickets. It's just not the thing that's done.

Monkeypatching is maybe more of a Rails thing than Ruby. I think the biggest problems with Ruby around the time Python began to take off were slowness (MRI was a disaster, slow, and full of memory leaks), plus patchy documentation (lots of things were in Japanese). Still, I preferred and prefer Ruby. Python has fantastic libraries, but it is a mediocre language. Ruby feels like a simpler version of Perl + Smalltalk,…

>Ruby's block, procedure and lambda design is a stroke of genius

Hardly. Not only was it nothing great, it had many variations, making it harder to remember.

Re: Ask HN: Why did Python win?

#610
post #604

If you think about it from the perspective of people learning programming, python is dead dead simple. In Unix like systems it comes preinstalled most of the time. For so many students in many parts of the world who use an HP/Lenovo laptop for university work the OS is windows and python installation is again, dead dead simple. Ruby starts off by saying you should have a version manager. And windows installation is n…

Another beginner-friendly point for Python: it has IDLE, a barebones IDE, included as part of the standard library. It's unfortunate Ruby doesn't provide such niceties to the beginners out of the box, given it inherited a lot of the Smalltalks, the language family with the best programming environments ever.
Post reply on HN