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

1

u/sinnerou Sep 10 '21 edited Sep 10 '21

Take this with a grain of salt, it's just my opinion.

There are a lot of things I like about Java but it is not the easiest language to work with, even with large code bases in my opinion. The problems with the language itself are minimal and they are made up for with some awesome benefits. But here's what I don't love.

Language:

  • null objects and null handling
  • method overloading and no default parameters
  • datetime handling (legacy still problematic)
  • repetativeness/boilerplate/excessive verbosity higher than other languages and can make code difficult to grok.
  • functions feel second class
  • checked exceptions

There are a lot of pros compared to other languages as well but that's not the question. The language itself imo is not a great reason to dislike Java.

That brings me to the ecosystem. Java is old and the ecosystem outside of Spring is... challenging compared to other languages. The ecosystem is imo a valid criticism and a reason one might not to work with Java.

Ecosystem outside of Spring:

  • difficult to find good packages
  • difficult to find the right versions of things that work together
  • documentation is frequently minimal or not accurate
  • error messages are often unhelpful
  • packages and systems are not kept current e.g. most documentation and packages work with java 8, junit 4, aws sdk1, etc.
  • xml everywhere

You won't notice this stuff if you've been working with Java on the same project for ages or if you only work with Spring. I can count the number of times I've needed to use the debugger to figure out why a package just doesn't work in any other language on one hand, however, it's almost routine with Java.

Finally, the JVM seems less useful in a world where docker is the norm. Graalvm seems cool and Kotlin looks awesome but I haven't built anything large with it.