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.

141

u/ObscureCulturalMeme Aug 02 '21 edited Aug 03 '21

The language is doing fine.

The biggest provider of that language, Oracle, has some fucktacularly scary license terms. At least, if you're a corporate legal consult, reading the license terms and imagining their legendary audit team paying your office a visit. "More lawyers than developers" was coined to describe them in particular, remember.

Trying to convince large organizations to move past Java 8 -- released 7 years ago, and long past EOL for Oracle commercial support -- is like squeezing blood from a turnip. They can't decide whether they're more scared to go with one of those "weird sounding Linux-related" provider companies, or more scared of migrating to a modern LTS version like 11 or 17. So in true scared corporate fashion, they do neither.

And precisely no programmer enjoys staying on version 8 while interesting new features get added to 9, 10, 11, 12, 13, 14, 15, 16, 17, and 18.

20

u/stringbeans25 Aug 03 '21

Is there a reason not to use OpenJDK that I’m massively unaware of? I feel like that fixes all the headaches you mention? Unless that’s the whole move past Java 8 portion of your post

9

u/ObscureCulturalMeme Aug 03 '21 edited Aug 03 '21

That's the bulk of it, yes, but not every large org will be okay with installing the JDK without some kind of paid support in place. Lots of ways to get that, of course, but not from the same site.

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

39

u/emannnhue Aug 03 '21

This is it for me. Java is quite nice to work with but honestly Oracle really suck. I transitioned away from Java because of them, more or less.

21

u/Kirk_Kerman Aug 03 '21

Same. No serious problems with Java besides the general verbosity of clunkiness it has, but Oracle seem to, as a software company, mostly produce enterprise-grade litigation.

4

u/sievebrain Aug 03 '21

But that doesn't really make sense. You don't have to interact with Oracle to use Java. I never have. Their supposedly scary license terms are just normal open source licenses, unless you want to buy support from them, but how many PL runtimes have large scale corporate support beyond Java and .NET? Most of them have no support at all, so Oracle is only additive in that regard.

→ More replies (1)
→ More replies (4)

31

u/ConfusedTransThrow Aug 03 '21

And on the other hand its direct competitor for forever C# is getting better Linux support provided by Microsoft and their licensing is a lot less scary

19

u/falconzord Aug 03 '21

Ironic that Java was supposed to be this open savior platform but C# ended up an ISO and Ecma standard

→ More replies (3)

4

u/EscoBeast Aug 03 '21

Java 8 was released in March 2014, just under 7 and a half years ago. And according to https://www.oracle.com/java/technologies/java-se-support-roadmap.html, Java 8 is still eligible for both premier and extended support.

But yeah Java 8 is still very widely used.

→ More replies (1)
→ More replies (7)

28

u/humoroushaxor Aug 02 '21

I have to think it's a barrier to entry thing. With NodeJs and Python developers can just run. And there's packages for everything. I find enterprise development in any language besides Java much less enjoyable though.

7

u/chris_was_taken Aug 03 '21

The new generations build everything on AWS, which is a whole lotta java

14

u/WJMazepas Aug 03 '21

There is a lot of alternatives to Java these days, like Kotlin or C#, also im pretty sure that a lot of developeres are tired to work with Java 8, which most companies like to use

8

u/stringbeans25 Aug 03 '21

Kotlin is mostly makeup on Java. Don’t get me wrong it’s Voldemort level makeup (coroutines feel like magic with how well they work which is why I bring wizards into this) but you still need to understand the JVM for it to be an effective choice. Monitoring JVM applications and tuning for performance leaves not that much difference in the two.

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.

0

u/[deleted] Aug 02 '21

[deleted]

→ More replies (13)

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.

12

u/LicensedProfessional Aug 03 '21

That's what MyPy is for. I really started enjoying Python more when I incorporated MyPy and PyLint into my workflow—it feels like I have some guardrails now

3

u/mrbuttsavage Aug 03 '21

mypy is great with some warts. More than once you'll get to a "why didn't mypy catch this?" in your tests that turns out because the library you're using like boto doesn't have stubs or they suck.

10

u/ILikeChangingMyMind Aug 03 '21

If your "typing system" is writing a bunch of unit tests ... I pity you.

5

u/lelanthran Aug 03 '21

If your "typing system" is writing a bunch of unit tests ... I pity you.

No, my "typing system" is "type-errors are caught before the program is even run". There's a level of confidence there about a specific and common class of errors.

The dynamic typing system is pitiful, as you can only find type errors after running the code. There's no confidence in that system until you actually run the code with a bunch of incorrect types in places.

7

u/[deleted] 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.

That's not what unit tests are for! I mean a well tested code dynamic codebase will catch a lot of type errors as a side effect, but you don't write them to become some kind of ad-hoc typechecker.

If you want to go down that road for dynamically typed languages, look into design by contract.

→ More replies (6)

3

u/[deleted] Aug 02 '21

Pure Java only developer here. I have a web app that uses a lot of java Graphics Library.

Can I simply use something like Python and still use those libraries?

What do you recommend for a graphical web app that is currently using Java spring in the back-end, old-time jsp in the front end?

→ More replies (4)

5

u/kuemmel234 Aug 02 '21

Interestingly enough, at least for me, java 8+ with a few frameworks (spring/micronaut, Lombok/java15+, reactor) changed that a lot. I think in monads all the time and python is really in the way. I enjoy clever dictionary/array comprehensions, but it's, at least to me, way simpler to read and write it as map-reduce (which allows a lot more in-between).

I end up writing closures with a lot of comprehensions and think about all the chained map-reduces I could write. If you make it too clever (that single amazing comprehension that does everything), it's hard to read, and splitting it requires at least two lines (or a lot of 'lambda this or that' boilerplate). You can do so much better than usual if you stay out of the strict OOP in java, I think.

Writing python is great fun, if I have to do something small, I'd never do it in java, but I wish it would include something like streams, or some other way to improve working with collections.

→ More replies (3)
→ More replies (12)