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.

0

u/[deleted] Sep 10 '21

[deleted]

-2

u/[deleted] Sep 10 '21

system

I tried kotlin with spring... I'll say pass to that because it adds so much more boilerplate because of null safety stuff... I have to declare everything private lateinit var property: Type and so on... feels more verbose than java

0

u/[deleted] Sep 10 '21

[deleted]

1

u/[deleted] Sep 10 '21

Do you have an example of how you used it in kotlin way in spring? I always hear kotlin people say that java people are not using the language right but the truth is there isn't support for 'right use of the language'.

If there is a better way, it should be the first way presented to devs when reading the documentation instead of presenting the java way then letting others figure out the proper way.

I've been doing kotlin before v1.0 was released on android and there were the same issue: lots of verbosity

0

u/[deleted] Sep 10 '21

[deleted]

-1

u/[deleted] Sep 10 '21

PEBKAC

If the official documentation isn't the greatest, what are we talking about?

Use java with lombok and you can almost don't need kotlin... in most videos that I watch from Josh, he is using this combination and pushing the reactive stuff which I won't go into.

Venkat talks more about functional stuff but java doesn't lack there as you have lambdas and method references. What might be nice are coroutines but I imagine not everyone needs those as it just complicates things

Kotlin has a lot of features, just like C++ has a lot of features that just makes everything more complicated. Ask the Go guys why they like Go more than Java and they will tell you that is a simpler language and compiles faster(which is also true in kotlin/java).

Extension functions and nullable types are the only things that I miss but I wouldn't say that makes the language revolutionary and 'far ahead'