3 ms·
I'm a Python answerer on Stack Overflow, I teach Python at NYU, and whaddaya know, I write Python for my day job. Why is it growing so quickly? I speculate: L
by aaronchall 9y ago
I'm a Python answerer on Stack Overflow, I teach Python at NYU, and whaddaya know, I write Python for my day job.
Why is it growing so quickly? I speculate:
Lots of people want to learn to program - and Python is easy to learn and teach.
I think it blows other languages out of the water. I'm going to compare it to its closest competitor, Ruby. Ruby is also open-source, high level, popular relative to other languages (which means you can probably get help if you need it), it has lots of libraries (meaning you can do a lot with it), ok tutorials, and a decent package manager. On the downside, Ruby is also a very large language, which makes it much harder to learn to mastery.
I think Python blows Ruby out of the water in terms of how easy Python is to learn relative to Ruby.
I don't encourage people to learn Ruby. I spent a long time (months) trying to learn it. I still don't tell people I know it.
I used to think that Ruby's syntax is twice as much to learn - now I think it might be even more than that.
Ruby's YACC file is ~918 lines long[0], while Python's grammar file is 149 lines long.
~$ wc cpython/Grammar/Grammar
149 879 6472 cpython/Grammar/Grammar
Even if 1/2 of Ruby's grammar output is whitespace, that's more than twice as much grammar to learn as Python's grammar[1].
I could compare Python to other languages, but I don't think they come close to matching the upsides of Python.
I still want to learn other languages, like Haskell, lisps, and C, to a level of mastery - but since I can be so productive so fast with Python, the other goals are something I work on in my spare time without a bunch of urgency.
[0] https://stackoverflow.com/a/16629318/541136 https://stackoverflow.com/a/16629318/541136
[1] https://docs.python.org/3/reference/grammar.html https://docs.python.org/3/reference/grammar.html
PS I can see that this comparison to Ruby isn't popular due to the downvoting - but nobody is contradicting my point.
- cbanks 9y agoCough. Python's cpython/Grammar/Grammar uses a compact EBNF notation. Converted to yacc it is about 850 lines long.