Live data from Hacker News

Java 20 / JDK 20: General Availability

mail.openjdk.org

61–70 of 356 posts

Re: Java 20 / JDK 20: General Availability

#61
As a Clojure programmer, I don't care about any of the Java language features or improvements, but I'm super happy that I'm getting a state of the art JVM that is continuously developed, maintained, extended and optimized, over a time scale of decades.

This is incredibly useful: having a good VM to run your code in, with good modern garbage collectors, is not an obvious thing (as many other languages have learned).

This is not the LTS release, so I won't be switching to it, but I'm looking forward to the next LTS.

Re: Java 20 / JDK 20: General Availability

#62
post #34

This is exciting, can't wait for the LTS release next year... that said, I don't much care for the "case SomeType t when ..." pattern matching syntax, I don't see the benefit of introducing a new keyword over using "if"... or even just "&&". To pinch the example used in[1]: case Tuner t && guitar.isInTune() -> ...; and case Tuner t if guitar.isInTune() -> ...; both seem as clear as case Tuner t when guitar.isInTune()…

The “&&” one is bizarre, it makes it look like the whole thing is a Boolean expression, which it absolutely is not. That gets even weirder because the part right of it actually is a Boolean expression, so on top of very confusing reading you now make it look like there are strange interactions with operator precedence. Using && is one of the worst choices. The “if” one does not suffer from any such problem and reads…

I think Rust uses "if" for its match guards too and I don't recall it upsetting anyone. I'm all for keeping things consistent between languages if only to prevent too much bike shedding.

Re: Java 20 / JDK 20: General Availability

#63

Earlier quoted context omitted.

https://github.com/tc39/proposal-pattern-matching I'm not sure if it's stalled or not. But it's being discussed.

We're still developing this proposal. be patient LOL

I've got infinite patience for the brave souls who propose and implement TC-39 specs. =)

Re: Java 20 / JDK 20: General Availability

#67
post #14

[flagged]

That people still write this kind of drivel and actually believe it on this site is frustrating. Every tool has a purpose and Java is a fantastic tool for a lot of use-cases.

That, and there are other languages (like Clojure) that are implemented on the JVM. I don't write any Java, but Clojure running on the JVM pays my bills.

Re: Java 20 / JDK 20: General Availability

#69
post #26

Now even Java has pattern matching, what's Javascript's excuse? Literally the only feature preventing Typescript from being my perfect language.

I don't see a huge benefit for pattern matching in JS outside of it being expression based rather than statement based.

Either way, the benefit has to be enormous. It's a feature that can easily break existing code.

Re: Java 20 / JDK 20: General Availability

#70
post #33

Java 8 is the best Java.

Why? Java 11 is already leaps and bounds better than Java 8.

Not the parent poster, but I can see why: IMHO, the best new feature for Java was try-with-resources (Java 7), and the second best new feature was all the functional stuff in Java 8. On the other hand, Java 9 started the introduction of several breaking changes (it took years before I stopped seeing updates to Java libraries to fix their compatibility with Java 9 and Java 11), so it can be seen why someone would think of Java 8 as the highest point of that language.

(For Java 9/10/11 in particular, there are several small enhancements, but nothing as earth-shaking as the changes we got with Java 7/8.)

Post reply on HN