r/Python • • Nov 13 '20

News Python swallows Java to become second-most popular programming language

https://www.theregister.com/2020/11/12/python_swallows_java_to_become/
2.3k Upvotes

205 comments sorted by

View all comments

585

u/[deleted] Nov 13 '20

C is #1 according to this article, if anyone wants the TL;DR.

A quote at the end that I found interesting:

"And Python's 'slowness' is overstated. Who cares about some other language that's a few nanoseconds faster if you spend hours (or days or weeks) trying to figure out how to use it? A human's time is more valuable than a computer's."

I think this quote just about sums up the creator's POV on other languages, specifically Java. I don't think he's really comparing Python to something like C/C++ because those languages will run circles around Python with more than just "nanosecond" margins if used properly. Not to mention other languages like C/C++ are mature and are used to build projects that last for decades, even longer. I still see companies struggling to move their technologies from Python2 to Python3 due to it's end of support.

I love Python and use it often, but in certain fields people have to care about speed, performance and stability. Sometimes it's a matter of life and death. I wouldn't even trust Java for those types of tasks tbh let alone Python. It's easy to learn and use and it's fast enough to do most tasks that people need, but I still think languages like C/C++ are superior.

8

u/[deleted] Nov 13 '20

Isn't Java used over C/C++ precisely because of it's stability?

9

u/utdconsq Nov 13 '20

Define 'stability'. Ive written a lot of Java, C, and C++. If you mean 'something that doesn't crash easily', Java is better than C or C++ typically because it helps you avoid out of bounds crashes and so on, but at the same time, until very recently it would blow up in your face due to NullPointerExceptions because you need to manually guard every bloody variable that isn't a primitive. Kotlin and others helped them realise that was shit, so they have changed the rules now. Meanwhile, in C, you are responsible for all checks on all things unless you use someone's library that does it for you. The standard library is super lightweight to the point of being unhelpful. C++ is better, with RAII and the STL, but due to the desire to be a superset of C, you can still shoot your foot off with raw pointers if you make the mistake of treating it like actual C instead of using the modern features of the language. For my money, JVM stuff has succeeded well because of things like Maven (love it or hate it), and nice stack traces. Never underestimate how productive you can be made if you can easily discover what in god's name broke!

8

u/x3r0x_x3n0n Nov 13 '20

We had a contest among us friends to write the best version of a breadth first search to solve a maze of 5000x5000 now i dont know about the capabilities of my peers they chose java i chose pure C. both ran it and I can tell you we gave up on the java programs and went out to have coffee. Legend has it they are still running to this day :D

0

u/[deleted] Nov 13 '20

[deleted]

11

u/panderingPenguin Nov 13 '20

All you've proved is that a language that's good for writing huge business systems isn't great for writing super tight, highly performant, implementations of search algorithms.

It doesn't even prove that. It shows that his friends probably screwed up and wrote something really slow or possibly even an infinite loop seeing as he suggests it may have never terminated.

-1

u/x3r0x_x3n0n Nov 14 '20 edited Nov 14 '20

Wait you didnt think we just ran it at a 5000x5000 maze right we tried a 30x30 maze too and all progams passed that one. Me and my friends may have negative IQ but we can handle a breadth first search.

5

u/panderingPenguin Nov 14 '20

That still doesn't mean your friends wrote remotely efficient code. It doesn't prove anything about Java, it just proves their code was slow.

2

u/benargee Nov 14 '20

If only the source code was here to do the talking.

1

u/panderingPenguin Nov 14 '20

I'm not trying to be argumentative. It's just that a couple programs written by random people are pretty meaningless as far as comparing language performance. It's certainly possible that you guys all are professionals, experts in your chosen languages, maybe work in the area of performance, profiled and optimized your code and wrote really efficient stuff. And that doesn't even get into questions like whether the fairest comparison is the fastest possible program in each language, the fastest idiomatic program in each language, a good faith attempt to write equivalent programs in each language, or something else entirely. But frankly, I doubt you guys thought through any of that. It sounds more like you wrote some code for fun to see whose was faster, and that's fine! But as a result, that's all it really proves: your program ran faster than your friends'.

→ More replies (3)

-1

u/x3r0x_x3n0n Nov 14 '20

I get your point but do tell me the features or lack thereof of C/C++ which do not allow it to write robust buissness code.

I would also go on to say that when ever ive seen web app backends ive seen them mostly in js, python, go, asp, php but thats dying out. Java isnt common there either.

It was breath first search just a simple algorithm from wikipedia no cryptic bitshift or 2 line swaps.

0

u/[deleted] Nov 14 '20

[deleted]

1

u/x3r0x_x3n0n Nov 14 '20

Great point. I think the mobile app market would be dominated by Java.

2

u/midnightcom Nov 13 '20

I believe Java is type safe where C/C++ are not. It's very easy to make a critical error in C if you don't know what you're doing. However the overhead of Java makes it impractical for embedded systems over C.

0

u/[deleted] Nov 13 '20

[deleted]

3

u/panderingPenguin Nov 13 '20

As someone who writes C++ for a living, fucking loooool

3

u/x3r0x_x3n0n Nov 13 '20

yep if you know the ropes C/C++ has got to be one of the most flexible languages out there.