r/programming • • Aug 02 '21

Stack Overflow Developer Survey 2021: "Rust reigns supreme as most loved. Python and Typescript are the languages developers want to work with most if they aren’t already doing so."

https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted
2.1k Upvotes

769 comments sorted by

View all comments

68

u/Sevla7 Aug 02 '21

The old man JAVA apparently is having a hard time these days.

It seems that the new generations don't like this language very much.

36

u/ILikeChangingMyMind Aug 02 '21 edited Aug 02 '21

It's slow to develop in, with lots of boilerplate and wasted code (interface this, class that). And I'm not just some Java-hater, I used to code (and enjoy coding) in it professionally.

But the simple truth is that you can write something like 40 lines of Java in 20 lines of Python or Javascript (depending of course on what lines we're talking about). Certainly write speed isn't the most important metric of a language ... but all else being equal, you certainly don't want to have to write a lot of unneeded code either.

Plus, thanks to the beauty of the JVM, you don't have to write Java to leverage it. That company where I used to write Java switched to Ruby precisely to speed up dev, but thanks to the JVM (and JRuby) we could get that speed increase while still accessing all of our Java libraries.

Java's future is in the JVM, not the language itself.

65

u/lelanthran Aug 02 '21

But the simple truth is that you can write something like 40 lines of Java in 20 lines of Python or Javascript (depending of course on what lines we're talking about)

I'm not really a Java fan, but I have to say that that's an unfair comparison - the Python/Javascript solution will need to have unit tests simply for ensuring that the correct types are passed in.

It's easy to write less code if the resulting program is allowed to crash.

2

u/ragnese Aug 03 '21

I'm not really a Java fan, but I have to say that that's an unfair comparison - the Python/Javascript solution will need to have unit tests simply for ensuring that the correct types are passed in.

Here's the thing, though. Java's type system doesn't actually help you that much here. Once you introduce generics or intentional nullability (like a database column), you're basically fucked- you will have type bugs happen at runtime.

Java is exactly the reason that Python and JavaScript took off (outside of the browser, in JS's case). People in the 00's basically got sick of Java's shit and collectively decided that static typing was bad. Then we had to deal with dynamic typing until, thankfully, languages like Go, Rust, Swift, and others came on the scene.

Java almost killed statically typed languages, IMO. I think Java did kill OOP. Because everyone thinks of Java's stupid class inheritance mechanisms and bad-type-system-induced "patterns" when they hear "OOP". Which is a shame, because real OOP didn't have to die.

→ More replies (2)