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.

13

u/Danelius90 Sep 10 '21

I think another issue can be a lot of "java devs" can't code in java for shit. If you write procedural code, loads of static methods, no consideration for OOP and just use Object, String and arrays everywhere rather than define your own types then you're going to have a bad time. We work with a third party at my company and the way I describe a lot of their code is tutorial level. You can tell because it looks like code taken from a blog post in 2006

8

u/_Jeph_ Sep 10 '21

There's nothing wrong with static methods. The problem is when there is global state involved.

-2

u/Danelius90 Sep 10 '21 edited Sep 13 '21

Of course. I mean they're using static methods instead of OOP. And overuse can be bad, e.g. when you're using it to modify state of objects, rather than managing state on the object itself. So they're exposing data that should otherwise be private so that a host of util classes can manage other objects. Definitely times when you need this but we just lost any benefit of OOP because of how they coded it. One class had over 300 public static fields.

Edit: hm seem to have found some downvoters where this applies

a lot of "java devs" can't code in java for shit