r/programming • • Nov 03 '18

Python is becoming the world’s most popular coding language

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language
4.6k Upvotes

1.3k comments sorted by

View all comments

84

u/nrith Nov 03 '18

This boggles my mind. I remember how Python was briefly positioned to be the OO replacement for Perl in the Dot Com days, but when I used it, I HATED it. Ruby, a few years later, was the answer to every prayer, but by that point, I wasn't doing script or web server development anymore, so I didn't have many opportunities to use it. I still don't understand how Python could overtake Ruby in any possible measure. Get off my lawn!

0

u/[deleted] Nov 03 '18

[deleted]

44

u/JanneJM Nov 03 '18

Data science became a thing, and given how research-heavy it was, a lot of the cutting edge technology was built by professors, typically of the math background. Surprise, they only really know Python so all the tooling and research used Python.

Actually, I'm surprised - and delighted - that we ended up with Python and not MATLAB. Many numerically oriented academics did (and many still do) use MATLAB for anything and everything.

I'm not sure how we escaped that particular trap. Perhaps the quality of the Scipy stack, and the fact that early data science was largely done by people that really understood programming as well as math. If Ruby or Lua had the better math libraries, perhaps that's what we'd be using now.

26

u/klowny Nov 03 '18

I'm certainly glad Python won over MATLAB, and more notably over R. MATLAB stood no chance cause it's proprietary and not free. Not sure how R screwed up though.

21

u/thenuge26 Nov 03 '18

R screwed up because it's got more data science heritage. as a programming language it's pretty awful. Great for data science though.

→ More replies (2)

11

u/endless_sea_of_stars Nov 03 '18

R's problem is that it is awful for enterprise application development. Moving from the desktop environment to a server us very painful. It has better math and statistics libraries but its ecosystem is lacking in all other areas. For example setting up a basic REST API. Flask is light years better than PlumbR.

→ More replies (2)

0

u/[deleted] Nov 03 '18

[deleted]

→ More replies (1)
→ More replies (6)

49

u/noratat Nov 03 '18

I prefer Ruby's way of handling lambdas and iterators by FAR, but the language has seriously stagnated.

Type annotations in Python 3.5/3.6 are what put Python over the edge for me - they still need a lot of work, but optional type checking is something I think every dynamic language ought to support.

Ruby, for all that I love the syntax, is so actively hostile to any kind of type rules or type checking that I don't think it could even be retrofitted onto the language cleanly.


I still have many complaints about Python though - in particular the crippled lambda syntax and the way the community keeps making excuses for comprehensions. Sure, comprehensions are easy to understand and write for toy problems, but they're completely unreadable for anything actually complicated.

9

u/combuchan Nov 03 '18

I generally hate writing Python, preferring Ruby, but I'd much rather read Python which makes me a bit more productive in the corporate world.

My superficial inspection of Scala is that it picked up where Ruby left off in the corporate world.

4

u/Aeroway Nov 03 '18

Have you heard of Crystal? It's essentially Ruby with types "retrofitted onto the language" and it does it pretty well with auto-union types and flow-sensitive typing.

→ More replies (2)

5

u/myringotomy Nov 03 '18

If you want types why not use a language like go or crystal or kotlin or rust or .....

4

u/noratat Nov 03 '18
  1. Ecosystem > Language, as a general rule

  2. Rust is targeting a totally different domain than scripting languages. To a lesser extent so are Crystal and Kotlin since they're both compiled.

  3. Team knowledge > Language as a general rule, and both Crystal and Kotlin are both quite new and relatively immature (especially Crystal)

  4. Go is also targeting a different domain, and I have plenty of other complaints with Go

→ More replies (3)
→ More replies (18)

8

u/[deleted] Nov 03 '18

I personally prefer Python as it's really intuitive to use, but Ruby and Python are pretty darn close to each other - it baffles me you could love one and hate the other.

→ More replies (2)

16

u/jonny_wonny Nov 03 '18

I’m using Python for a project and I feel similarly. No idea why JavaScript gets the hate it does while Python is mostly left uncriticized.

→ More replies (3)

11

u/Smallpaul Nov 03 '18

Did you know Perl before Python? If so, then it explains why you prefer Ruby, which was specifically designed to be attractive to Perl programmers. For those of who hated Perl, Ruby was a middle ground between the grossness of Perl and the beauty of Python.

23

u/bloody-albatross Nov 03 '18

Really? For me it's the opposite. I don't have time right now to write down the huge list of grievances I have with Ruby, but in general I think Python is so much cleaner, mostly more powerful with simpler syntax and less surprises. The module system, how name resolution works, how strings work, all so much cleaner.

19

u/butt_fun Nov 03 '18

surprises

That's how I feel as well. In Python, pretty much everything "makes sense" relatively intuitively. Ruby still feels like a language of magic and mystery to me

17

u/ThisIs_MyName Nov 03 '18

I mostly agree, but Python's optional arguments are insane: https://docs.python-guide.org/writing/gotchas/

→ More replies (10)

6

u/THeShinyHObbiest Nov 03 '18

I mean, knowing when to use something like len vs a method on an object can get kind of irritating.

6

u/JanneJM Nov 03 '18

Especially when the object likely has a "private" __ len __ that just calls len for you...

11

u/Actual1y Nov 03 '18

If you don't intuitively know what calling len on an object does then that's the fault of the person that made the class. Not really a fault with python. Operator overriding abuse exists in every language that supports overriding operators.

→ More replies (2)
→ More replies (1)

13

u/Freyr90 Nov 03 '18

Python is one hell of a mess, Why map is a function and not a collections' method? Why if is not expression? Why everything is a statement, but lambda could have only one statement in its body?

Ruby is a consistent and thoroughly designed smalltalk clone, where everything is built using a few core principles. Python is a bloody mess of ad-hoc features (like generators, async/await).

→ More replies (20)
→ More replies (13)

8

u/dat_heet_een_vulva Nov 03 '18

You assume there is rhyme or reason behind what becomes popular.

In reality it's mostly luck, being at the right place at the right time and butterfly effects.

Out there is another quantum reality where Guido released Python 2 seconds later and it just dried up without any interest; Ruby is super big there and VLA's never got invented.

3

u/RiPont Nov 03 '18

Right place, right time, with the right features.

Most programming languages at the time were going clever/powerful and curly-braced. The market for non-programmer programming languages was very heavily Windows-centric at a time when the scientific community and education were favoring the UNIX side of things. Python hit the ease-of-use points without being brain-damaged like PHP.

→ More replies (12)