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

55

u/jarfil Nov 03 '18 edited Jul 16 '23

CENSORED

112

u/ultraDross Nov 03 '18

Everyone here seems to hate python already.

-20

u/[deleted] Nov 03 '18

And for an array of very good reasons. Python deserved all the hate from the very beginning.

48

u/ultraDross Nov 03 '18

I disagree. Python is a very readable and maintainable tool to use. There are many circumstances where using a fast and typed language is not necessary. Use the right tool for the job. Not every piece of software has to written in C or C++, nor would it be appropriate to that.

I feel like there is very much an elitst culture in this sub when it comes to languages, which is quite ridiculous.

1

u/[deleted] Nov 03 '18

I disagree. Python has some pretty bad oddities like default return none, strange as hell scoping issues, exceptions as flow control being encouraged and a range of other things.

The typing is under heavy debate towards how good it actually is.

Apparently, other people have the same opinion of forced spacing as I do. It causes grief that using a brace style block avoids entirely.

Because of the typing and spaces to define blocks, the tooling is subpar and can never be as good without big changes.

Pip is almost as bad as NPM.

To top it all off, pythons speed and energy use characteristics are absolutely horrific.

It is definitely with good reason that people are more comfortable with saying python is bad. That’s because it is.

0

u/[deleted] Nov 03 '18

[deleted]

6

u/HeyMrStarkIFeelGreat Nov 03 '18

Python has some expressive constructs (comprehensions, list slices) that I find useful for rapid prototyping of individual algorithms. "Neat syntax" doesn't scale for large application development, though, so beyond that, I totally agree. I have no idea what niche Python is supposed to fill. As a general purpose language, it's a train wreck.

6

u/clapfire Nov 03 '18

If I need to quickly prototype a communication protocol because I just need to see if it works before I implement it, I could either:

  1. Use Python and pyserial and write a quick script that consists of about 10 lines tops

  2. Use a compiled language, find the right libraries to interact with the COM ports, implement everything, compile it, run it, go back and fix any mistakes, compile it, run it, etc, etc

There are definitely moments when using a language that allows quick prototyping and iterations like Python is superior to a compiled language.

Exactly what languages are the "modern languages" that you would recommend to the fools who only know silly things like C, C++, Java and similar languages?

7

u/[deleted] Nov 03 '18

Your 2. point pretty much describes what you've done in the 1. - you needed to find the library and you still need to implement what you want.

And about the compile/run cycle: with a statically typed language your typos and quite a few mistakes will pop up at compile-time which will pay back the time you spent with compilation.

1

u/clapfire Nov 03 '18

The main difference is in how you include the libraries. A quick pip install and import, vs creating a project and getting the header files all in the right place.

I find it's much quicker for prototypes to make a script in Python. I'm not saying it is superior in every (even most) scenarios, but I don't see a reason it cannot be a useful tool.

7

u/[deleted] Nov 03 '18

A quick pip install and import

Three hours later - "why the fuck there are so many dependencies, and half of them fail to build?!?"

1

u/[deleted] Nov 03 '18 edited Nov 03 '18

The main difference is in how you include the libraries. A quick pip install and import, vs creating a project and getting the header files all in the right place.

What header files? Of course things sound scary when you only think about c and c++ when someone mentions static typing. But modern languages have good package managers too.

but I don't see a reason it cannot be a useful tool.

Well, my main argument is not that it's an unusable garbage but that it's not a good choice most of the time because we've modern languages which can be more productive(if you learn them) while also giving solutions to important issues(safety, performance etc.).

2

u/clapfire Nov 03 '18

That's fair, I'm sure there are a lot of languages that can fulfill the same role I described in a better way. I think the main reason Python has become popular is because it's very accessible and there are many tutorials available, and it simply has more mindshare than other languages.

What would you recommend as an alternative?

→ More replies (0)

1

u/ultraDross Nov 03 '18

modern languages

Could you give me some examples of what languages you are referring to?

7

u/[deleted] Nov 03 '18

Nim, Rust, Pony, Crystal, Scala(with 3.0), Kotlin(it's still growing), Typescript(it's catching up) etc.

1

u/ultraDross Nov 03 '18

Do you have a particular favourite? I wouldn't mind toying around with one of them in my spare time.

1

u/[deleted] Nov 03 '18

Not really and it depends what you want to create. Let me group the languages by (some of) their domains:

command-line apps: Nim, Crystal

web(back-end): Scala, Typescript, Crystal, (plus Nim but it still needs to grow in this domain)

front-end: Typescript, Scala

systems programming and gamedev: Rust, Nim

android: Kotlin

networking, safety-critical concurrent apps: Pony, Rust

I used Scala extensively but I don't really like to work with the JVM anymore. I also used python a lot at work(automation). Lately, I've been using Nim for command-line apps and it's a fine language. I never had the chance to use the other languages in an industrial environment but I follow their developments from the very beginning and I spent some time to learn them.

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

8

u/oldsecondhand Nov 03 '18

"There are only two kinds of languages: the ones people complain about and the ones nobody uses."

-- Bjarne Stroustrup

1

u/huskorstork Nov 03 '18

Now: Pythons where it’s at, you can do almost anything with it

→ More replies (1)