Live data from Hacker News

Java 20 / JDK 20: General Availability

mail.openjdk.org

141–150 of 356 posts

Re: Java 20 / JDK 20: General Availability

#141

Earlier quoted context omitted.

I mean, that's OK though. Not sure why this is considered such a bad thing. You're missing out on some new language features, sure, but Java 8 is still reliable and rock solid. There's lots of companies that have hesitation or even inability to upgrade, hopefully there's at least some initiative and/or direction to do so. A company that is head-in-sand deliberately not upgrading from Java 8 is one thing. A company th…

> I mean, that's OK though. Not sure why this is considered such a bad thing For existing software, sure. But the problem I guess is when there are a lot of newer projects starting and everyone is stuck on the older version

Totally fair. I guess I would hope in that case that the new effort would target a modern Java release, preferably Java 17 or greater. If a company is sticking with Java 8 for new initiatives, yeah, they probably have a culture problem and are not going to be happy with that decision.

Re: Java 20 / JDK 20: General Availability

#142

Earlier quoted context omitted.

We're still developing this proposal. be patient LOL

Wow that's a proposal! I really like the idea of pattern matching, and I'm glad you're steering clear of modifying switch, but I find the sketches in the proposal pretty hard to read, especially with the combinator examples. I hope you guys take your time and stay more proud of what you leave out than what you put in.

This is something that far too few folks put in their progress/change logs.

"We didn't do ..." is so incredibly important.

Re: Java 20 / JDK 20: General Availability

#143

Earlier quoted context omitted.

What’ the hype with pattern matching? What does it solve?

If you've ever done any assembly programming or worked with other old or low level languages, you may have encountered an environment where you can write simple operator expressions, but you can't compose them. So this is OK: a = b + c d = e - f g = a * d But the compiler doesn't allow: g = (b + c) * (e - f) You have expressions that produce, but they don't compose. You can't produce a value from a more complex, nest…

Is Dart's pattern matching influencing the JS proposal as well? Or are both sort of separate without much influence from either side?

Re: Java 20 / JDK 20: General Availability

#145
Structured concurrency looks a lot like C#'s Task library without the async/await sugar but with the exact same footguns.

Joining into a synchronous function is an anti-pattern in C# because you consume threads. This seems to be the same, except with the assumption that virtual threads are fine.... But that's not an assumption that can be made by the method writer, right?

Re: Java 20 / JDK 20: General Availability

#146
post #135

Earlier quoted context omitted.

I mean, that's OK though. Not sure why this is considered such a bad thing. You're missing out on some new language features, sure, but Java 8 is still reliable and rock solid. There's lots of companies that have hesitation or even inability to upgrade, hopefully there's at least some initiative and/or direction to do so. A company that is head-in-sand deliberately not upgrading from Java 8 is one thing. A company th…

There's very little reason not to upgrade from Java 8 at this point. Everything should be a drop-in replacement and there are significant performance benefits (garbage collection is leagues better) to doing so. The bigger problem is that a lot of places are stuck on Oracle JDK - 8u252 is the last free version so a lot of places just decided they'd never upgrade, nor do they want to look at whether Temurin or Coretto…

> Everything should be a drop-in replacement

It isn't at all, in my opinion. Consider the introduction of the module system, for example.

Some libraries moved out of the core language.

Re: Java 20 / JDK 20: General Availability

#147
post #79
post #69

Earlier quoted context omitted.

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.

How would it break existing code?

Because it is an expression that introduces a new keyword.

You could say “return match…”

It’s not easy to introduce without breakage. Not saying it cannot be done.

But PHP didn’t manage to for example. It also isn’t real pattern matching but that’s a different issue.

Re: Java 20 / JDK 20: General Availability

#148
post #94

Earlier quoted context omitted.

It's interesting how the introduction of "modules" has forced so many to stick with C++17 and Java 8.

C++ has barely any feature complete compiler implementations and build systems aren’t ready for all of its additions, either (CMake and modules in particular). libstdc++ and libc++, gcc and clang are all not ready for production use or rather untested and/or buggy. Unless you’re targeting MSBuild Visual Studio Solutions and Windows only, C++17 is currently the most up to date, stable, and battle-proven version.

It's a shame "C with classes", as C++ originally was, didn't stick around for parallel development.

I work with C daily and I'm well aware of its many shortcomings (e.g. its huge list of undefined behavior and its PDP11-centric view of modern architectures), but with some effort I believe it could function as a semi-portable second-level intermediate representation. Nim uses it as such, IIRC.

Compiling to C first would introduce some of its own issues, for sure, but I imagine doing so would alleviate the pressure the C++ standards committee puts on compiler vendors each time they expand the size of the kitchen sink.

Re: Java 20 / JDK 20: General Availability

#149

And here I am still on Java 8 :/

My codebase at work is written in Java 8, I honestly don't see what other benefits upgrading the language would bring. There's already so much business code written in the old Java 8 style (which works), don't go trying to change how the code is written now. To me Java 8 is simple and boring like Go, with some imperfections like the lack of a native map data type.

I'd still upgrade for the new VM's better performance/security patches or whatever, but I don't need any language changes.

Re: Java 20 / JDK 20: General Availability

#150
post #26

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

What’ the hype with pattern matching? What does it solve?

It makes it very easy to deal with nested data structures. Imagine creating a nested map/struct literal, and then extract the values out using a very similar syntax on a single line.

It's one of those things that when you get used to, you wonder why other languages don't implement it.

Post reply on HN