Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

801–810 of 856 posts

Re: Ask HN: Why did Python win?

#801

[flagged]

Please don't start flamewars on HN. Programming language flamewars are particularly easy to avoid, and avoiding them has always been a priority here because we're aware of what happened to certain other forums, which burned themselves to a crisp and never recovered.

We detached this subthread from https://news.ycombinator.com/item?id=37315605.

Re: Ask HN: Why did Python win?

#802

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 agree with these as major points. A few other secondary ones Ruby was primarily maintained in Japanese, so had a barrier to entry for language level issues. It also lacked english-language evangelists and university presence. When Ruby was new (invented 1995) Python had some older design issues (as it was 6 years older) however it really recovered and implemented a lot of change through Python 2 (2000) and python 3…

Wasn’t python released in 1991? That would make it 4 years old when ruby is released.

Re: Ask HN: Why did Python win?

#803
post #684
post #571

Earlier quoted context omitted.

> However, when it is about finishing a project, beating C++ or Java ecosystems is almost impossible. Yet, somehow people do this with python, perl, and ruby. Google hires professional python people too.

Not only do this, but do it way more successfully. I'll never get tired of repeating that among top YC startups, Java as a primary language contributes to roughly 1% of value, while Python + Ruby are almost at 70%. https://charliereese.ca/y-combinator-top-50-software-startup...

If by successfully you mean time to market, for sure you are right.

C++ gives more return when you start to save in infra because you have a more efficient language, if coded properly. Same goes for Go vs Python.

The right tool for the right job. I would use (and will, I am on it) Django for a SaaS that I have for the backend. If things start to work relatively well, then, I will keep identifying, if there are, bottlenecks and migrate with a hybrid architecture parts of the workload to C++.

This allows me to save in infrastructure bills.

Re: Ask HN: Why did Python win?

#804
post #673

Earlier quoted context omitted.

This is an accurate explanation. I started to teach myself Python just before 2000. The general consensus before then was that for a first language Perl or Python would be a good choice. Python was typically preferred because it was more approachable than Perl i.e more succinct. With no prior programming experience (besides manually typing out programs into my C64 as a kid) I managed to build a program that connected…

> it was more approachable than Perl i.e more succinct. My dim memory of that time is that Python code was often longer than Perl, but that was OK because its selling-point was that it didn't have so many syntax edge-cases and it was easier to read. More things were actual words-for-humans as opposed to special symbols one had to memorize and apply according to special rules.

You are probably right. "Succinct" implies it was short and clear. Maybe a better word choice would have been "clear" or "readable".

I remember the creator at the time saying that he wanted a program language that was more like a natural language i.e the programmer could express the same idea in a multitude of ways. Maybe this approach resulted in code that was easier to write than to read since understanding natural language relies heavily on context and convention.

Re: Ask HN: Why did Python win?

#805
post #648

Earlier quoted context omitted.

Ruby has implicit imports which pollute namespaces. This is extremely annoying for anyone who wants to learn the language. It uses extensive monkey patching, which is once again a substantial challenge for a beginner that wants to understand what their code is doing. It has a nicer syntax with procs and lambdas but syntactically distinguishes between them with different ways of invoking functions and all the issues a…

I don't think either of those issues, namespaces and monkey patching, are things that make the language harder to learn. You require a file, the file's namespaces are available. How often do libraries modify your runtime with monkey patches in a way that you'd notice? I'm sure it's come up during my career, but not when I was a beginner. There was a period of time when metaprogramming was more popular in the ruby and…

Requiring a file from a library that's part of a framework's source code can be quite challenging as it requires either the complete docs or perusing the source code to fully grok what's getting included, especially with the monkey patches.

I don't know the current state of the RoR ecosystem but back then when both languages were competing for similar mindshare this was a massive turnoff.

Re: Ask HN: Why did Python win?

#806
post #785

Earlier quoted context omitted.

If the length of mylist ... see how length comes first? Only unintuitive if you never spoke English or other european languages.

With all other object oriented structures you would think that you want to do something with the mylist, thus you would first write down mylist. In Ruby I thus often write something such as: if mylist.empty?.! Because my line of thinking goes from the object to a function or attribute and then chains further along. Calling the `.!` method on the returned boolean object is very nice, because I don't have to go back to…

I haven't written any Ruby. Maybe one gets used to this after some time, but this honestly looks like it will enable you to write extremely clever and succinct code that makes perfect sense at the time, but a chore for anyone else to read and grok quickly (including the writer themselves a few weeks later). I could be wrong though.

Re: Ask HN: Why did Python win?

#807
post #719

Earlier quoted context omitted.

I've checked the article and the comments are awesome, not sure what you're talking about. People disagree with you, respectfully, explaining why they think you're wrong. What did you expect from the "welcoming" community, ignoring the critique?

Not ignoring, but taking it seriously without demagogy and trying to prove that 2+2 equals to five.

I’m not an expert in Python by all means and not going to take any side. I’m just saying that the comments look meaningful and the commenters seem to be open for discussion. It’s definitely not a norm in modern Internet, which is already great.

Re: Ask HN: Why did Python win?

#808

Earlier quoted context omitted.

https://arstechnica.com/science/2015/12/certain-customers-sp...

It is off topic to the python/ruby discussion, but I wonder if there is a way to discover if I am one of these people.

It seems simple enough:

a) a tendency to buy oddball products

b) track record of finding that products you use are discontinued

That is all there is to it. There is no psychometric test or theory.

Re: Ask HN: Why did Python win?

#809
post #515

Earlier quoted context omitted.

You are mistaking syntax for features. C++ got popular because it managed data structures under the hood automatically. I.e, you didn't have to keep track of memory offsets or function pointers. Java got popular because it did that and also managed memory allocation under the hood automatically. Python (and Javascript) got popular because it did all of that and also managed types under the hood automatically. The fut…

Javascript got popular because it was the only option to program for the web. That's it. Python and other dynamic languages don't "automatically manage types", they just let you not write the types down in the code. The types still exist and need to be managed by the programmer. There's zero cognitive load improvement there. As for the AI stuff, lol. I see no point discussing concepts so far out of reach they're in t…

>Javascript got popular because it was the only option to program for the web. That's it.

If it wasn't as flexible as it was, another language would have taken it over.

>Python and other dynamic languages don't "automatically manage types", they just let you not write the types down in the code.

They do. They carry dynamic type information during runtime, and can be modified during runtime.

>What you're describing is just magic compared to what we can do in 2023.

Then you must think that stuff like branch prediction, and compiler optimizations are magic as well.

Re: Ask HN: Why did Python win?

#810

Earlier quoted context omitted.

You are mistaking syntax for features. C++ got popular because it managed data structures under the hood automatically. I.e, you didn't have to keep track of memory offsets or function pointers. Java got popular because it did that and also managed memory allocation under the hood automatically. Python (and Javascript) got popular because it did all of that and also managed types under the hood automatically. The fut…

The discussion isn't about C vs Python, it's about why Python won over Ruby, a language at a similar level of abstraction. Ruby is arguably even less burdensome because in many cases the libraries/frameworks do a lot of magic that would be unpythonic.

Ruby has a lot more idiosyncracies, especially with cross platform stuff. Like I said, the more the language does for you, the more its going to "win".
Post reply on HN