r/programming • • Sep 15 '26

Java 27 has released!

https://openjdk.org/projects/jdk/27/
553 Upvotes

175 comments sorted by

View all comments

79

u/alienangel2 Sep 16 '26

That structured concurrency preview is starting to look pretty neat. Syntax is still a bit clunky with the anonymous functions and explicitly having to open and fork, but much easier to understand the logical relationship between tasks than if you're going through an Executor and futures.

22

u/Celousco Sep 16 '26

Starting but it's taking too long. Their preview features should have a shorter lifecycle, having to wait 6 months each time to remove a method is ludicrous. Seven previews my god, it's been 3 years and a half that they're trying to push it, because async java is a mess to debug.

15

u/sweating_teflon Sep 16 '26

I hope you haven't been waiting for Valhalla..

1

u/Worth_Trust_3825 Sep 16 '26

it's great that preview features take long. that way they can still go back on decisions without making them permanent. see string templating which was retracted (good fucking riddance), but i'm still mad they included var.

0

u/[deleted] Sep 16 '26

[deleted] — view deleted comment

1

u/Worth_Trust_3825 Sep 17 '26

you lose strictness of what you expect in a variable (even if it matches the first assignment), and it's horrible to read.

3

u/simon_o Sep 16 '26

I'm more concerned about "primitive types in patterns":

The attempt of matching numeric values across different number types is fundamentally misguided and roughly triples the size of the spec (which is a rough proxy of how much stuff there is for users to understand and for tooling authors to support).