Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

121–130 of 856 posts

Re: Ask HN: Why did Python win?

#121

I really wish schools would teach compiled languages before scripting languages.

Great news, python is compiled, you got your wish.

Unless you use pyc it's only as compiled if you count php as compiled. Just in time bytecode compilation does not a compiled language make.

Re: Ask HN: Why did Python win?

#122

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…

You're forgetting the period of Ruby's popularity in the devops world, especially Chef and Puppet.

Re: Ask HN: Why did Python win?

#123
post #31

I first encountered Python around 2000. At the time Perl was more popular in the circles I frequented, and TCL probably about as popular as Python (eggdrop[1] notwitstanding), but Python was growing steadily. I encountered Ruby in the late '00s (as others have noted it made its english-language debut almost a decade after Python started) and Lua was another contender during this time. My memory is that, at least outs…

I think it upset the Perl hegemony in part because of the enterprise infatuation with object orientation. Perl got a lot of flak from the Java/XML crowd (“Perl’s not a real language—it’s not object oriented!”). You could kind of write Java in Python, and thus a certain kind of enterprise techie couldn’t dismiss Python as “just” a scripting language.

In my experience, Perl got a lot of flak for being "write only", I don't really remember anybody complaining it wasn't "object oriented".

Every Perl code base I've seen, or inherited, has been a mess. My favourite was a bunch of utilities all written by the same person who never did anything the same way twice. Each utility was like an entry in an obfuscated 'C' contest.

I used Perl to build my first web application at LONG time ago. That project is included in the list of Perl code bases I've seen that were a mess :-)

Re: Ask HN: Why did Python win?

#124
post #31

I first encountered Python around 2000. At the time Perl was more popular in the circles I frequented, and TCL probably about as popular as Python (eggdrop[1] notwitstanding), but Python was growing steadily. I encountered Ruby in the late '00s (as others have noted it made its english-language debut almost a decade after Python started) and Lua was another contender during this time. My memory is that, at least outs…

Before Python got popular, Perl was the most similar popular language. Once I encountered Python, I felt, this is Perl, but done right.

+100

I loved Perl, but it had a culture of doing things in N different ways, too many shortcuts, and you ended up with incredibly tiny scripts which were unreadable -- even to the author -- a month later. This wasnt practical for business use in the face of more consistent code from Python

Re: Ask HN: Why did Python win?

#125

Earlier quoted context omitted.

Great news, python is compiled, you got your wish.

Unless you use pyc it's only as compiled if you count php as compiled. Just in time bytecode compilation does not a compiled language make.

Maybe you should have been more precise when you made your wish to the monkey paw. Because python is certainly a valid answer to the comment you wrote.

Also I think you’re completely wrong but that’s neither here nor there.

Re: Ask HN: Why did Python win?

#126

I really wish schools would teach compiled languages before scripting languages.

What's the current CS101 standard? I know when I was in college in the late 1990s, it went from Pascal to C++ to Java.

In college, sure - they actually started us on C/C++ and then had us work in ASM for discrete math...

But in middle and high school now I believe they teach...whatever the teacher wants. So a lot of js, python, vb...

Re: Ask HN: Why did Python win?

#127
Python was developed in the late 80's and first released in 1991 - it's been around awhile. One of the things that always made it useful before it became so popular is its great interop with C/C++.

Ultimately that interop led to NumPy and SciPy, which allowed you to use a rather simple language and yet get high performance when doing calculations. That, as they say, was that.

It doesn't hurt that Python is a multi paradigm language - unlike many of the other popular languages today demanding a particular mindset for programming. You want to do structural programming? Fine. Object-oriented? That's fine too. A little bit of functional (lite)? There's some limited capabilities for that too.

Add in 30 years of Java JIT compilation optimizations that's been applied to Python interpreted code, C/C++ interop - Python is a simple, yet powerful language. That's why it's become so popular.

Re: Ask HN: Why did Python win?

#129
post #68

When I first encountered Python, it was as an alternative to Perl. Given the choice between Perl and Python, I think it's clear why the latter won out.

> When I first encountered Python, it was as an alternative to Perl. Me too I am amazed that Python won out against Perl Perl is much easier to use. Does not have the incredibly irritating treatment of whitespace Perl was a disrupter, whereas Python was "computer sciencey". A false dichotomy but it really mattered to people

Perl is a write-only language, whereas Python almost reads like pseudocode. They're on absolutely opposite ends of the readability spectrum.

Re: Ask HN: Why did Python win?

#130

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

Only one of the items in your "such as" list is unique to python's philosophy, and that is "there should be one way to do it". Ruby embraces the many ways to accomplish something, it's true. However, the three others are not unique to python. Ruby especially embraces "readability counts". And I can't think of anything in the ruby language itself that is implicit over explicit. Perhaps you are thinking of rails and comparing that to python.
Post reply on HN