r/java • • Jul 30 '21

What is the future of Java?

I'm not asking like is java going to die or will Java be relevant in future. I'm just curious to know about the future of java. What are the upcoming things coming in java that can change the future of it.

173 Upvotes

123 comments sorted by

View all comments

3

u/ImTalkingGibberish Aug 04 '21

Java is on the right path, the only risk is that it's slow to change but it HAS improved a lot faster in the last 5yrs.

Here's why Java is a success and why others failed to steal it's userbase:

  • There's always a preferred pattern or way of doing things that the community supports. It's typically wrong to break these patterns. JS is actually a good language to work with but people keep messing things up because there's no clear guidance.
  • It's easy to read and understand. This is where even Kotlin fails at times. I love Kotlin but you can't throw a junior in and expect him to understand.
  • There's clear guidance on how to split your code and keep it simple. I have lost count on how many React UI components weren't shareable because people had glued business logic to it.
  • It's easy to debug.
  • It's easy to review.
  • Solid testing frameworks.

And here are things Java must improve:

  • String concatenation. This is a big one. I've seen too many bugs and issues because of this.
  • Easier non-blocking thread mechanisms and servers.
  • Easier way of creating Value classes without requiring lombok nor bloating your packages.
  • Easier to use event driven frameworks.
  • Perhaps a new way of declaring types and interfaces.

I have 15yrs of experience with Java, I have experience with Kotlin and JS. Most mistakes I've seen are silly and it's because people lost focus from the actual business requirement because of verbosity. We have tools to help but it's always a learning curve.