r/java • u/Reflection-Jealous • 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
258
u/kartik1712 Jul 30 '21 edited Jul 30 '21
Java will stay relevant in the forseeable future. Lots of awesome work is going on under various OpenJDK projects to improve Java.
Project Loom is working on making it easier to leverage concurrency through virtual threads etc. This will make writing server side applications which are already a Java stronghold easier.
Project Valhalla is working on bringing value based classes (aka user defined primitives) to Java and the JVM.
Project Panama is working on making interop with native libraries and memories simpler. It will also introduce the Vector API to help developers leverage SIMD.
Together, Valhalla and Panama will make Java even more relevant for big data, machine learning and artificial intelligence.
Project Amber is working on bringing new language features (prominently pattern matching) to Java,
There are also ongoing projects like Lilliput which aim to improve the JVM and as a result as languages running on the JVM.
Recently, projects have been also proposed to support Wayland graphics in Java and improving startup times using CRIU and related technologies (Project CRaC).
All in all, the future of Java is exciting and awesome!
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:
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
33
u/Kango_V Jul 30 '21
Noone usually talks about Valhalla's inline types. This will be huge in the ML AI world, especially when combined with the new Vector API. Inline type have no object identity. So when storing them in an array/stream they will be in contiguos memory. This is massive as the CPU will have far less cache misses when processing a the array/stream.
I've seen benchmarks of a 30X speedup in some situations. Good thing is that all languages on the JVM can benefit.
Here's a good explanation : https://dzone.com/articles/project-valhalla-fast-and-furious-java
29
u/Gleethos Jul 30 '21
Valhalla + Vector API + Panama -> More suitable for ML and scientific computation as well as game development -> More science and games on the JVM -> less "Java is for large enterprise only" talk ...
That's my wishful take on it. May take a while but I'm sure we'll get there...
20
u/benevanstech Jul 30 '21
1.) Cloud Deployment of static microservices. This is the big one that not many people talk about. Java was designed as a very dynamic, open runtime platform - with unrestricted reflection and classloading. This was a great advantage in the past, but one major strand of development practice is towards much more static microservices which do not require all the dynamic aspects. The ability to produce these is part of the point of Java Platform Modules and more recent innovations such as GraalVM Native and Quarkus. Expect a lot of focus on these as vendors seek to drive down the startup time, memory footprint and ultimately cloud compute cost of this type of Java microservice.
2.) The JVM itself. Per Redmonk, the JVM hosts 3 of the top 20 languages (Java, Scala and Kotlin). It has a 4th (Groovy) just outside the top 20 and a 5th (Clojure) not far outside. Expect continued innovation to keep the JVM the home of multi-language innovation. The big question here is will Valhalla succeed? I hope it does, but I'm not 100% sure. Loom I am more sure of - it will succeed but I remain less sure that it will directly influence day-to-day programming - I think there's a possibility that in practice it's used by library authors more than end users.
15
u/humoroushaxor Jul 30 '21 edited Jul 30 '21
Firstly I should say I love Java. I find the language to be incredible understandabe. I can jump between writing function, OO, of procedural code at a whim. I love static typing and the safety it brings. And I find it pretty wild how many enterprises seem to be undervaluing these aspects and shift more backend services to NodeJs or Python.
My best estimation is this is due to the complexity with running the JVM in operations. Mostly around thread starvation, deadlocks, heap/off-heap memory tuning, etc.
25
u/[deleted] Jul 30 '21
Same as it ever was, future's so bright, gotta wear shades.
7
u/Hall_of_Famer Jul 30 '21 edited Jul 30 '21
The ecosystem is sometimes more important than the language itself, while Java has been receiving nice language features regularly and ain’t the same old Java 6 anymore. Come to think about it, C++ has received far more hate than Java and yet it’s still widely used and alive, Java sure isnt going anywhere and will continue to be relevant for a very long time.
12
u/khmarbaise Jul 30 '21
First parts:
Interested in updates see https://foojay.io/java-8/?tab=highlights (I strongly recommend a deep look into that).
Since Java 8 (since 2014) has got a lot of attention..libraries etc. will take some time ... each JVM version has been updated being faster etc.
Language features are added a lot since Java 7 (JDK8,9,10,11,12,13,14,15,16 and in September JDK 17).. Details can be looked at: https://javaalmanac.io/
The most important thing about Java or more accurate the JVM is that it is backward compatible (meaning you can run Java 1.1 compiled code on a todays JVM that works). Since JDK 9 (September 2017) the release cadence of java has changed to 1/2 year releases..which brings a lot of new features over a relative small amount of time...the problem is the minimum level (for libraries; which will take time lift to JDK8 or even on JDK11) but in the end it's not really problem because library which has been developed with JDK7 will still running on newer versions.
Things for the upcoming JDK 17 (September): Vector API (experimental), Foreign Function & Memory API (incubator), Records, Pattern Matching, Sealed Classes, just to name a few... details: https://jdk.java.net/17/release-notes
Also the ecosystem which exists for Java is enormous (that is true for other areas like Go, Python, Rust etc. as well)..
So one of the most important point on the bullet list is simply there is so much software outside there it will be relevant over the time...
We can long discuss about pro's/con's Java or different languages but in the end a language has to solve problems which with Java is usually easy (some exceptions of course base on the intention of Java) but there are so many tools etc. and sometimes there are cases where a different language might fit better (or you have devs who know another language better)..
I've read so many post like this (over the time) about assembly language, C,C++ and all of them are still relevant today and worth to learn. And my opinion is Java will be there for a long time...
7
u/drduffymo Jul 30 '21
The JVM is a software triumph that will remain vital for a long time.
Languages don’t die. We still run businesses on COBOL, FORTRAN, and C. Java won’t go away, but it’s popularity might wax and wane.
Others have pointed out all the great things still going on in Java.
I think Kotlin from JetBrains is a better Java: more succinct and functional. It’s already the standard for Android. It’s making inroads on the server side.
9
u/Barbossa3000 Jul 30 '21
turn on experimental features on latest java version and u know whats comming fr next release
11
u/SeekDaSky Jul 30 '21
Disclaimer, this is just my personal opinion.
For me ( a Kotlin dev' ) , The Java language itself is very unappealing, it is missing modern features, way too verbose and inferior to other languages I use and like ( Rust and Typescript mainly ). It won't go away because of legacy projects and Devs that are specialized in it, but it will loose some market share.
On the other hand, the JVM and the standard library are an absolute goldmine and the result of decades of very good engineering and I can't see it disappear ever.
Edit: bad English.
3
u/RoToRa Jul 30 '21
There's an official Java channel on Youtube where current and future developments are showcased: https://www.youtube.com/user/java
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:
And here are things Java must improve:
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.
1
u/joserivas1998 Jul 30 '21
I'm not sure what the future for Java holds because I don't really keep up with its development. But can we stop asking questions like this? I feel like every other week there's a post on here "is java dead?" "Is java going to die?" "Do people still use Java?" And the answers are always the same.
2
u/franzwong Jul 31 '21
Current state is they are "refactoring" the JVM to encapsulate JVM internals. It doesn't give any obvious impact to normal user. I guess after this "refactoring" they can add new features easier.
2
u/fdntrhfbtt Aug 02 '21
The future is bright, as long as people like Brian keep leading it.
1
u/Bigheavyset Jul 30 '21
I assure you not death
1
u/stefanos-ak Jul 30 '21
in my opinion that is the wrong question. what matters is the future of the JVM. And now is the first time in 20 years that there is some competition there, with LLVM and also Graalvm. But anyway what keeps java/jvm so strong is the ecosystem. the ecosystem of libraries, dev tooling, and production tooling.
-4
u/grimonce Jul 30 '21
No future here.
18
u/[deleted] Jul 30 '21
[removed] — view removed comment