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.
Ask HN: Why did Python win?
321–330 of 856 posts
Re: Ask HN: Why did Python win?
#322Python 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)…
What I understand is that Python was popular in the anglosphere as a general purpose language first, Ruby was somewhat popular in Japan earlier as a general purpose language but didn't become popular in the anglosphere until Rails.
Re: Ask HN: Why did Python win?
#323Earlier quoted context omitted.
If there's a winner, it's still named "Java".
I was talking in the context of the Ruby/ Python/ interpreted language world of the parent post
Re: Ask HN: Why did Python win?
#324Python has a lot of native things like list dict sort join etc, you need library much less often your code gets very very short.
Python has some functional programming in it, which makes it even more flexible than C++ in my view.
Python is just so readable with its indentation style, very few language do it like this. I even started to make a C-ish language with indent-style scoping, it's a bit difficult but I did it.
Even if it's one of the slowest language out there, it's so good and simple that you realize that what matters is not the language speed, but what matters is what you write. A good and fast software must be well designed first, the language choice comes second.
Python is VERY OFTEN the best choice because its simplicity lets you write better software more easily, so in my view, a language like python allows programmers to write better software.
Programming language philosophy matters.
Re: Ask HN: Why did Python win?
#325The way I (somewhat hazily) remember it, Python was mainly competing with Perl as a scripting language, not Ruby as an application/web language. I started hearing about Ruby years later when Ruby on Rails drove the Web 2.0 movement, but that feels like a different era to me. Eric S. Raymond wrote an article[1] in 2000 about his experience trying Python after spending a lot of time with Perl. I'll quote some of it her…
People decided to wait on doing anything big, since Perl 6 wouldn't be quite compatible. Later it turned out to be extremely incompatible. And Perl 5 would be dead long term, so why spend time on it, when you'd have to do a radical rewrite soon?
Meanwhile, Python was there.
And Perl 6/Raku took 15 years to finally arrive in some form, by which point Python had completely eaten its lunch.
Re: Ask HN: Why did Python win?
#326Earlier quoted context omitted.
I use pip 100% of the time
>> I use pip 100% of the time What about pipenv, poetry, conda, setuptools, hatch, micropipenv, PDM, pip-tools, ActiveState platform, homebrew, or your Linux / BSD distro's package manager?
If Python is only managing Python code, the issues to be solved are VASTLY simpler. Just about anything works.
Once it has to deal with dynamic libraries, compiled code, plugins, build systems, etc. the combinatorial explosion just makes life suck.
Re: Ask HN: Why did Python win?
#327Earlier quoted context omitted.
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…
There was definitely a group of people who thought "object oriented" was the One True Way and any languages that don't support it are "toys." I'm not sure I ever heard their ire directed at Perl specifically, but I recall the sentiment existing.
Rust doesn't even sport 'Class'
Re: Ask HN: Why did Python win?
#328Python 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…
Today I learnt I'm fucking old. My first web programming exposure was Perl CGI scripts
Re: Ask HN: Why did Python win?
#329Earlier 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)…
> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though
Besides the one you mention, I also find the "Explicit is better than implicit" line to be against everything Python stands for. The language is chock full of implicit behavior, and strongly encourages writing implicit code. From the dynamically typed nature of the language itself, to being able to define dunder methods that change the behavior of comparison and arithmetic operators.
I really like Go partly because of this. Not only does the language itself stictly follow the explicit over implicit and TOOWTDI principles, but it encourages or even enforces them on the programmer.
Re: Ask HN: Why did Python win?
#330> Ruby has clever syntax. Python has pure syntax.
> Ruby has method aliases. Python does not allow a string to capitalize itself.
> Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function.
> Ruby has strict object-oriented encapsulation. Python is laid-back about objects, because you probably know what's going on inside them anyway.
> Ruby lets you leave off parentheses so you don't miss objects having attributes too much. Python will let you mix tabs and spaces for indentation, but passive-aggressively mess up your scoping as punishment.
> Ruby has seven kinds of closures. Python has one, in the unlikely case a list comprehension won't do.
> Ruby's C implementation is a mess of support for language-level flexibility. Python's C implementation is so clean you get the unsettling thought that you could probably write Python using C macros.
> Ruby supports metaprogramming for cases when programmers find it more descriptive. Python supports metaprogramming for cases when programmers find it necessary.
> Ruby is expressive. Python is direct.
> Ruby is English. Python is Esperanto.
> Ruby is verse. Python is prose.
> Ruby is beautiful. Python is useful.
> I like Python, but coming to it after using Ruby for seven years, well, I think it's like dog people and cat people. You can like having one species around, but you're always thinking -- why they can't be more like the other?
-- This is one of my favorite HN comments of all time: https://news.ycombinator.com/item?id=682364