5 ms·
I mean, if you're willing to give up the ecosystem, there are tons of options out there.
by platz 9y ago
I mean, if you're willing to give up the ecosystem, there are tons of options out there.
- carlmr 9y agoExactly, the ecosystem is the only reason IMHO why Python is "easy". I find I'm much quicker at developing C#/F# if the library is available on NuGet (which is often, but not always the case). They're both reasonably fast, too. Python only has a very large community and thus ecosystem to offer.
- dTal 9y agoIt can't be the only reason, or how would it ever have attracted such an ecosystem in the first place? Especially with its performance characteristics, and lack of corporate backing. No, Python was invented at a time when its closest competitor was Perl - and you need only compare typical Perl with typical Python to appreciate that Python really was a usability revelation. But that was nearly 30 years ago. I do think we can do better now.
- vgy7ujm 9y agoIME Perl can be more readable if you are experienced in Perl.
- rthomas6 9y agoAnother reason is the documentation. It's fantastic.
- carlmr 9y agoFair point, I was importing the diapers module 30 years ago. But I think in today's world the advantage is mostly in the ecosystem. How the ecosystem came to be is another story.
- dorfsmay 9y ago• the language is easy, very attractive for non-CS people • the language is consistent (everything is an object, or a pointer to an object rather, you can only pass by pointer, scope and namespace that make sense all the time, etc...) • you can learn it gradually, you can start using it even if you know only 10% of the language • Amazing documentation. The official tutorial is easy to read, and by the time you are through with it you are fairly proficient with python • error message that tells you exactly what the error is and where it is happening. A lot of other languages do that now, but that wasn't the case 25 years ago. • inline help / magical docstring (`a=4 ; help(a)`) • The REPL, especially being able to get into the REPL with your apps (`python -i`) • batteries, again 25 years ago, no language came with such a huge standard library • PEP 8, the grandfather to gofmt and rustfmt. Makes a big difference when working on a team • the Zen (`import this`) And of course as the language grew in popularity: • the ecosystem (pypi.org) • the amount of resources, from books to website, the answer to every questions you can think of in SO, very active and helpful mailing list/usenet group, active and helpful /r/Python
- bzbarsky 9y agoScope and namespace that make sense all the time? for foo in bar: pass # Why is "foo" in scope here???
- NoahTheDuke 9y agoBecause Python doesn't have block scoping, only function scoping.
- bzbarsky 9y agoYes, my point is that function scoping can hardly be described as "makes sense all the time". Especially given that variable declarations in python are _very_ implicit, without even the "var" that will indicate to you that you're messing with your function scope in JavaScript.
- empthought 9y ago> Yes, my point is that function scoping can hardly be described as "makes sense all the time". Block and function scoping both "make sense all the time." Whether or not you personally are accustomed to a language's design decisions does not have any bearing on whether or not those decisions "make sense." In the particular case you cited, of course it is natural that `foo` is in scope outside of the loop; it appears in a line outside of the loop. This is trivially evident in the indentation.
- bzbarsky 9y agoThe context is that we're talking about people picking up the language for the first time, coming from other languages. What matters is whether the scoping rules make sense to such people. For that, it matters whether they're coming from another function-scoped language (or are familiar with one), and whether they're used to having their variable declarations being obvious or not. For me, when I was first learning Python, this scoping issue was a significant pain point. This is obviously an anecdote, not data, but again for purposes of "people first coming to the language" it's relevant. Obviously once one has worked in Python for a while one internalizes things like this, just like one internalizes various things in other languages that are obvious pain points for beginners.
- dahart 9y ago> It can't be the only reason ... that was nearly 30 years ago. I do think we can do better now. Maybe the ecosystem is the only reason left today. The reasons for initial adoption 25 years ago and the reasons for widespread usage today probably aren't the same reasons. Numpy, Anaconda & Jupyter notebooks didn't exist then, and now they're a huge reason for Python usage. I can't even think of a language that comes with a standard library that rivals Python's, let alone the ecosystem.