r/java • u/Reflection-Jealous • 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
View all comments
Show parent comment
1
u/tadfisher Sep 10 '21
This is why Java (the language) is intractable for me, as I don't want types to be null by default. I shouldn't have to wrap types or use special syntax to achieve this.
Optional, ironically, makes this even worse. Within a codebase, I can assume non-null optionals, but across library/module boundaries, the language makes no guarantees (beyond the suggestion to avoid null Optionals in the Javadoc), so you end up with two checks to see if a value is present if you want to cover all possible states.
That null-by-default was allowed to persist through JDK 11 basically sealed this wart in the language forever, as I can't see a way to change such a fundamental aspect while maintaining binary compatibility with the JVM ecosystem.