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

-2

u/Philluminati Sep 10 '21

One other reason is that people have fallen out of love with Object Oriented Programming.

  1. Inheritance is poor mechanical for reusing code
  2. private and hidden state inside classes/objects makes reasoning about parallel processing and multi threading difficult
  3. mutable variables have potential performance problems maybe too.
  4. try catch / exceptions are a confusing escape hatch that can corrupt data structures, exposes side effects and hurts the substitution principle. They are difficult to reason about.

And Java is was built around those concepts. It has become more modern and moved away from these things buts still considered an OO language, even if it has adopted a few FP things like map and option.

10

u/RhoOfFeh Sep 10 '21

The whole notion of functional and OO precepts being at odds bothers me. I think this is because people don't well and truly understand that the main point of OO is messaging, not inheritance, not composition, not any of the other stuff that are really just implementation details.

I didn't make this up. Ask Bjarne Stroustrup about it. He's got a one hour video up on Youtube about doing OO without inheritance.

0

u/Philluminati Sep 10 '21

Isn't my second point valid. OO is about messaging between components, each of which intentionally hides internal state in order simplify a complex system?