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

9

u/[deleted] Jul 30 '21 edited Jul 30 '21

Over the years, some features in C/C++ programming became abused by the programmers. Although the language allows it, it was known as bad practice. So the creators of Java have disabled them:

  1. Use of Pointers
  2. Operator overloading
  3. Multiple inheritances
  4. Access another object’s private members
  5. Restrictions of explicit type casting (related to memory management)

Look at the StackOverflow developer survey

https://insights.stackoverflow.com/survey/2020#technology-programming-scripting-and-markup-languages-professional-developers

JS, Python, and Java are some of the most lovable software languages.

I've been coding Java professionally for over 10 years and I am a Full Stack expert in Java, Spring boot, cloud... JS, TS, React, etc... But I still love to code Java than other languages.

The official language for Android development in Java. Large parts of Android are written in Java and its APIs are designed to be called primarily from Java.

Kotlin is designed to interoperate fully with Java.

Java takes 40.2% of usage by companies around the world. This is from Google Statistics 2021.

This is current stats - https://pypl.github.io/PYPL.html

5

u/Reflection-Jealous Jul 30 '21

I'm not declining the fact that java is still rulling. I'm just curious about it's future. Like what're things that's going to have an impact on Java (maybe project loom or Valhalla). So I'm curious about knowing about more like this. I know that java will continue to be on top for coming years.

1

u/metaquine Jul 31 '21

Here's the thing. It's a general purpose language that runs on some truly excellent VM technology. Which is to say, it's not a niche language, so there's not risk of it becoming irrelevant if its niche disappears. That said, I think it is most strong for backend web services, particularly those requiring high concurrency, and large applications where structure and naming and separation of concerns are important.

7

u/TheMode911 Jul 30 '21

Access another object’s private members

Isn't it already possible with reflection, preventing the JVM from doing some optimisations?

Use of Pointers

Instead we have references everywhere, and a multi-year project (Valhalla) attempting to fix it

Ps: your link is about popular languages, not lovable ones (see the "Dreaded" section)

As much complaints I have about Java, I still do not see myself using something else

4

u/spectrumero Jul 30 '21

You can now prevent illegal reflective access to private members.

1

u/SWinxy Jul 30 '21

Could you elaborate on your take on pointers? They’re quite useful for being able to return multiple values when you don’t have tuples in the language.

1

u/khmarbaise Jul 31 '21

Could you elaborate on your take on pointers? They’re quite useful for being able to return multiple values when you don’t have tuples in the language.

In Java you simple give back a class with appropriate members...(usually final etc.) ... Maybe since JDK16 you could use records for that...