Ask HN: Why did Python win?
201–210 of 856 posts
Re: Ask HN: Why did Python win?
#202Python 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…
Re: Ask HN: Why did Python win?
#203Re: Ask HN: Why did Python win?
#204Earlier 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.
It would seem that having a standard is more popular.
Re: Ask HN: Why did Python win?
#205Re: Ask HN: Why did Python win?
#206Earlier quoted context omitted.
Numpy is certainly amazing, but there are tons of competitors in the data/scientific space, which pure "A-type" data scientists tend to prefer: R, SSPS, Matlab... The difference is that Python doesn't entirely suck as a general-purpose language. Sure, you might have better options, but it's still reasonable to write almost anything in Python. Other scripting languages like Ruby, JS and Lua are probably a little bit b…
Matlab costs $$. Matlab was ahead in perf for a long time, not sure now. E.g. they used to JIT code, etc. Comparing python to R, python feels like a much more mature language. R always seemed only useful for small scale projects, e.g. writing some script to process data with < 20 lines of code. Python codebases just scale much better.
It's not the best way to write analysis code, and it's not the best way to write a web service, but it's probably the best way to write analysis code that runs on a web service.
I picked web services as a random example, not one I'm particularly passionate about. But as a general trend, if you want to combine 2 unrelated domains, Python probably has you covered better or more easily than just about any other language.
Re: Ask HN: Why did Python win?
#207Earlier 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
Re: Ask HN: Why did Python win?
#208Your impression is wrong. Python goes back to 1988. It was known in FOSS circles in the 90's: a minority within a minority.
The rise of the web exposed more programmers to FOSS, due to pretty much everyone in web eventually having to work with GNU/Linux servers. More developers than ever were suddenly exposed to cruft that only a few GNU/Linux and Unix geeks were previously privy to.
Eric S. Raymond (ESR) was once influential, and wrote articles on Python; he helped draw attention to the language.
For instance, this article in the Linux Journal
https://www.linuxjournal.com/article/3882
For me, that article stands out in my memory as when I became more consciously aware of Python; that there may be something there.
I suspect that the article had a big impact; I'm not the only one.
People read rags like Linux Journal then. Sysadmins, developers, students, hobbyists.
Re: Ask HN: Why did Python win?
#209What concepts does a language force a new user to be aware of, and how reliable are user's first intuitions about those concepts? I would argue that Python dominates Ruby in this metric. New users wonder how to call functions. They form an intuition ("use parenthesis"), but it's unreliable. "Oh, parenthesis are optional--oh, parenthesis are only optional sometimes". New users wonder what a function is exactly. They f…
print f"are you {sure} you need parenthesis to call a function in python"
>Python is much more boring in this respect, users are more likely to form accurate intuitions.
is defining a class the same as defining a function? What about functions implicitly defined when you define a class?
__what__ is __with__ __some_words__?
why do you need an empty file called init.py in the same directory as your actual code?
Re: Ask HN: Why did Python win?
#210Earlier 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.
I figure if Django built an entire framework around metaprogramming, I'm going to do it to Django model objects as a form of vengeance.