Live data from Hacker News

Java 22 Released

mail.openjdk.org

81–90 of 178 posts

Re: Java 22 Released

#82
post #58

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.

Actually a nice feature. This solves the public static void main string args issue. Still if I need JVM then Scala or Kotlin are still preferable over Java. Obligatory Java for the Haters in 100 Seconds: https://www.youtube.com/watch?v=m4-HM_sCvtQ

I've never seen a java codebase I thought couldn't be better in kotlin

Re: Java 22 Released

#83

Earlier quoted context omitted.

Java continues to evolve to a bad Groovy.

How so? I don't think there are many good things to say about Groovy, but I generally agree with most new features introduced to Java. What do you think Groovy does better?

- String interpolation

- triple-quote strings / blocks

- minimal class boilerplate (this posting)

- closures (Java closures are worse IMO)

- usable hashbang for UNIX

- I think java has strings in switch now, don't they? Do they have expressions?

WAIT, does Java STILL force you to write getter/setters?

Re: Java 22 Released

#84

Earlier quoted context omitted.

Java continues to evolve to a bad Groovy.

Groovy itself is a bad Groovy.

bad opinion is bad

I get gradle is a disaster (but that's more of a poorly managed and evolved DSL problem)

But ... does anyone use Spock and think "groovy sucks"? Yeah, I doubt it.

Re: Java 22 Released

#85

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.

this will probably show up in java 23, ctrl + f "simpleio"

https://openjdk.org/jeps/8323335

Re: Java 22 Released

#86
post #73

Earlier quoted context omitted.

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.

You can but for a new user that is even more of a barrier than writing out System.out.println

Re: Java 22 Released

#87

Earlier quoted context omitted.

How so? I don't think there are many good things to say about Groovy, but I generally agree with most new features introduced to Java. What do you think Groovy does better?

- String interpolation - triple-quote strings / blocks - minimal class boilerplate (this posting) - closures (Java closures are worse IMO) - usable hashbang for UNIX - I think java has strings in switch now, don't they? Do they have expressions? WAIT, does Java STILL force you to write getter/setters?

features that make strings easier to use are bad in my opinion. the number one problem in java is people circumventing the type system with strings.

switch on strings is there, as are switch expressions.

records now removes the need for getters in immutable contexts.

Re: Java 22 Released

#88

Why would I use Java 22 over Kotlin?

To me the question "Why would I use X over Y?" in programming space is a bit redundant. Why would I use Kotlin over Closure? Why would I use Groovy over Scala?

Even only considering JVM languages you run in to way too many options for the question in itself to be worth your time as a serious discussion.

IMO - use whatever you and your team like best and that suits your needs. Java is great for hiring new devs and is arguably the most well established in an enterprise settings.

If you want an actual answer: Personal preference.

Re: Java 22 Released

#89
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…

Oh that’s right. My company didn’t want to pay the insane Oracle fees to keep getting support. I think it wasn’t even a discussion once the saw the number, but that’s basically a rumor.

So we have to stick to OpenJDK which means 8 doesn’t receive security updates and is untenable.

Re: Java 22 Released

#90
post #26

Earlier quoted context omitted.

The FFI is also an artifact of CLR type system and the ability of have proper stack value based types.

They will eventually bring value types to Java with Project Valhalla.

Noting that Valhalla value types are about guaranteeing object value identity with memory layout and/or flattening supposedly deriving from that. Modeling unmanaged sequence of bytes within the type system (like receiving a typed buffer from un managed code) might still be challenging
Post reply on HN