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

Show parent comments

0

u/[deleted] Sep 10 '21

[deleted]

7

u/pron98 Sep 10 '21 edited Sep 10 '21

What had that effect was the acquisition of Sun by Oracle. The cause of lack of innovation and the cause for Kotlin's existence was the same -- the decline in investment in Sun's dying years. Constant innovation was always the goal, and it happened when Java had the resources. It only declined because the money dried out.

As to particular features, while the size of the language doesn't matter -- ML has been the biggest influence on Java innovation -- and we've certainly taken ideas from Scala (the use of sealed hierarchies to represent sum types), we haven't yet from Kotlin, but maybe we will someday (nullability types?). But if any languages light the competitive fire under Java, it's the bigger ones -- Python, JS, maybe C# -- the ones that are actually competitive, not languages with 20-25x smaller market than Java's, and certainly not those that are built on the Java platform (Oracle sells support for the platform, not the language).

3

u/papercrane Sep 10 '21 edited Sep 10 '21

we haven't yet from Kotlin, but maybe we will someday (nullability types?).

I would be the happiest developer in the world if Java had some concise way for me to express in the type system that something was never null.

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.

→ More replies (6)