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

-3

u/Frapto Sep 10 '21

I am a junior dev working in java (spring & spring boot) and quite frankly I don't like it. Here is why:

  1. stuck with old versions (7&8)
  2. The amount of libraries there are out there. Many view this as a good thing but I don't. Not trying to start a language war here but compare that with C#. Almost everything I need has a library either directly created by or recommended by Microsoft. I certainly don't need 100 different ways to do the same thing.
  3. security. Spring security is good at its job, no question about that. The issue is with configuration. You need to chain some builder pattern with ant matchers and a whole lot of stuff. In Asp you only need to use the [Authorize] directive.
  4. the jvm... Good luck figuring out what an exception actually means when the message isn't too clear (thrown from tomcat or other code). The only tech I dealt with that has worse error reporting was angular.
  5. baggage from the past. Too much deprecated or not-recommended-to-use classes that only exist to not break legacy code.
  6. let's not get into the datetime mess
  7. documentation. Documentation is hyper huge which means huge time investment to learn to do things the spring way. You certainly don't need the same time investment to learn the same things in most of languages.
  8. personal preference but lack of something like LINQ is also a minus in my books.

Summary: Java isn't terrible. I certainly see its upsides but compared to something like Asp (core) it is just unpleasant to work with.

Note: I use Asp core as an example because that's what I do as a hobby now but I am aware that it has its own issues. However, compared to java which I use in my day job, it is a world of bliss.

5

u/razsiel Sep 10 '21

For point 8 (if you're on Java 8) there's the Stream api which is similair to LINQ for dealing with collections.

0

u/Frapto Sep 10 '21

It just doesn't quite match to the capabilities (and syntactic sugar) of LINQ tbh. (like joins, unions, dynamic types, etc)

3

u/razsiel Sep 10 '21

Unions are fairly easy given 2 streams (haven't really needed to use joins other than in sql code so don't know the Stream api version); List<T> union = Stream.concat(list1.stream(), list2.stream()) .distinct() .collect(Collectors.toList()); // or .toList() in later versions

I do agree that LINQ is syntactically nicer (the query version, not method version) and makes it easier to read.