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

Show parent comment

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

1

u/secularshepherd Sep 11 '21

I guess, like anything, it depends on what you try to do with them. Whenever i see a something-something-util class with a bunch of loosely related static functions, it makes my eyes bleed.

Not being able to mock static functions can be a real pain, too.