Live data from Hacker News

Java 22 Released

mail.openjdk.org

71–80 of 178 posts

Re: Java 22 Released

#71

Maybe my favorite feature in this release: https://openjdk.org/jeps/463 Finally solves the inscrutable Hello World program! Yes, it's just ergonomics for early beginners. But could be the difference in whether or not someone new to programming sticks with Java or not.

This is exactly what I've been calling the "public static void main problem" for years (and an illustration of why I thought something like BASIC or Python should be everyone's first programming language). Neat to see the Java team come up with a solution for it. But "public static void main" runs deeper, and has to do with immediacy: shortening the time between the programmer giving instructions to the computer and seeing the results of those instructions being executed. It makes the smallest possible Java program greatly simpler and absent unusual comments that beginning programmers might struggle with; but there's the issue of the compilation step as well! If they make Java REPL-driven they might well have a winner!

Re: Java 22 Released

#73

Maybe my favorite feature in this release: https://openjdk.org/jeps/463 Finally solves the inscrutable Hello World program! Yes, it's just ergonomics for early beginners. But could be the difference in whether or not someone new to programming sticks with Java or not.

Maybe in another ten years they'll remove System.out.println and allow for a simple println to be used. Or maybe we'll all move to Kotlin by then.

You can statically import System.out if you are so inclined.

Re: Java 22 Released

#74
post #9

Foreign Function Interface is one of the key advantages what C# had over Java (e.g. against huge APIs like Android or macOS). I am really curious how this JEP turns out.

For anyone reading, here's a link to the page with detail on this project: https://openjdk.org/jeps/454

Re: Java 22 Released

#75

Earlier quoted context omitted.

Boring changes like these are what keeps Java interesting. New and shiny syntax sugar becomes stale real quick.

As a modern language Java is still quite feature deficient. But you can use compiler plugins like the manifold project[1] to level up. 1. https://github.com/manifold-systems/manifold

I see Manifold as a huge leap past previous tools Immutables or Lombok. I understand there's a use case where you want to add these language features to an existing code base. But for the most part if you want the language features on the JVM, you should probably just use Scala. That gives you a set of established patterns, best practices, libraries, and a community of users.

If you want type safe SQL in particular, you can pry JOOQ out of my cold dead hands.

Re: Java 22 Released

#76
post #46

It's kind of startling to see how many places still use Java 8, estimated at ~1/3 of projects according to a survey i just googled. And something like half that still use java 11.

Wasn't the whole point of Java never releasing a 2.0 that there would never be breaking changes? Seems like something went very very wrong with Java if the state they are in is that the language refuses to make breaking changes and the developers refuse to take up the supposedly non breaking updates due to breaking changes based on the comments I'm seeing here. So the language never improves as much as it can and the developers never update anyway making the whole point of non-breaking changes moot.

Re: Java 22 Released

#77
post #46

It's kind of startling to see how many places still use Java 8, estimated at ~1/3 of projects according to a survey i just googled. And something like half that still use java 11.

In practice, Java is the language of legacy and Android.

Java 8 keeps working, while "modern" Java keeps chasing mistakes like green threads. If anything, I'm more baffled by 9+ having a non-neglegible market share at all.

Re: Java 22 Released

#78
post #68
post #56

Earlier quoted context omitted.

8 reached EOL in the last year or two. I think 11 is still under LTS. Part of the problem is the changes made between 8 and 17 could be incredibly disruptive depending on your libraries. If they had stuck to not using sun.* stuff you were pretty safe, but a few very popular things did. Then somewhere in there a lot of the common server stuff moved from javax.* over to jakarta.*. Both were needed and very good, but co…

> 8 reached EOL in the last year or two Java 8 is still under Extended Support until 2030 (and indefinite sustaining support). Java 11 left Premier Support September 2023. "Java SE 8 has gone through the End of Public Updates process for legacy releases. Oracle will continue to provide free public updates and auto updates of Java SE 8 indefinitely for Personal, Development and other Users via java.com". https://www.o…

Oracle JDK support is not the same as OpenJDK support (for both better and worse).

Re: Java 22 Released

#79
post #46

It's kind of startling to see how many places still use Java 8, estimated at ~1/3 of projects according to a survey i just googled. And something like half that still use java 11.

Wasn't the whole point of Java never releasing a 2.0 that there would never be breaking changes? Seems like something went very very wrong with Java if the state they are in is that the language refuses to make breaking changes and the developers refuse to take up the supposedly non breaking updates due to breaking changes based on the comments I'm seeing here. So the language never improves as much as it can and the…

Java 8 allows access to unsafe methods, which despite being meant for internal JDK use only, have been widely used in external projects. Newer Java versions do not permit the use of unsafe except for the JDK itself.

It wasn't ever part of the public API that's promised to never break, and JDK developers were annoyed that it being used meant Java got perceived as unstable, and it's gone in more recent versions.

Re: Java 22 Released

#80
post #46

It's kind of startling to see how many places still use Java 8, estimated at ~1/3 of projects according to a survey i just googled. And something like half that still use java 11.

In practice, Java is the language of legacy and Android. Java 8 keeps working, while "modern" Java keeps chasing mistakes like green threads. If anything, I'm more baffled by 9+ having a non-neglegible market share at all.

> Java keeps chasing mistakes like green threads

If by green threads you mean virtual threads in JDK 21 could you please elaborate why they are a mistake? I'm not a Java developer but from what I see new concurrency model allows to write much more efficient network software - OS threads are expensive (in terms of RAM/CPU) and to handle many thousands of network connections (C10k problem) you have to either throw a lot of hardware or use NIO (New/Non-blocking I/O) which is hard to code.

One of reasons why Go become popular - gorutines look like normal threads (relatively easy to code) but more efficient.

Post reply on HN