r/java • • Sep 10 '21

Why people don't love Java?

I came across this post in r/cscareerquestions it seems majority of the people don't love to work with Java.

Is there any specific reason for that?

Edit: Thank you guys for your responses, I can't reply to all of the comments because I'm a beginner myself and I don't know what to reply for all your comments.

201 Upvotes

379 comments sorted by

View all comments

542

u/thomascgalvin Sep 10 '21

The people posting to that sub are typically young, and probably have more experience with Javascript than anything else.

Compared to JS, Java can feel heavy and constricting. Lots of boilerplate, a type system that's strictly enforced by the compiler, and so on.

It isn't until you have some real-world experience, with code spread out across dozens or hundreds of files, that you realize the "limitations" of Java are actually meant to prevent you from blowing your own foot off.

75

u/maomao-chan Sep 10 '21

Lol the duality of JS programmers, praise Typescript but hate statically typed language like Java.

45

u/[deleted] Sep 10 '21

The especially amusing thing is people claiming that Java is slow, while their favourite language is Python. That's how you can tell they're just repeating memes they've heard, and ones that haven't even been true since the 00s (modern Java is very fast)

17

u/thomascgalvin Sep 10 '21

Modern Java can be faster than C in some instances. The current generation of VMs are insane.

3

u/ihbarddx Sep 10 '21

Java faster than C? I've heard this. Any specific examples? Any specific examples where all C variables are static?

15

u/Rakn Sep 10 '21 edited Sep 10 '21

People always compare fast Java code with highly optimized C code. You cannot beat highly optimized C code. But the thing is that most people do not do such optimizations. I have been working in a project where we had dedicated employees tasked with optimizations. But a normal developer is unlikely to look at the produced assembler code and refactor the C code on that basis. If you do normal feature development, especially in the web service area, Java beats many alternatives in terms of speed. Obviously not at the first iteration. But at some point the JIT kicks in ...

At least that's my take on it.

→ More replies (2)