News for hackers. Stuff that matters.
Re:Java 21 makes me like Java again by owlstuffing on Sunday September 17, 2023 @10:58AM (#37545686)
Of all the features most Java devs (and ex-Java devs) desire, algebraic types are near the bottom.

How about intersection and union types? (NO, sealed classes are not a substitute for unions).

But, yeah, in my view JDK 21 is a a disappointment. I rarely want pattern matching, but I would like properties please and records are nice, but actual tuples are more useful. Etc.

Re:Java 21 makes me like Java again by smrtinsert on Sunday September 17, 2023 @11:27AM (#37546058)
I would love a union type in Java, but I still enjoy the language, community and especially development experience. I wouldn't recommend it for everything, but it's sturdy by design and enjoyable for when it fits.
Re:Java 21 makes me like Java again by mx_02 on Sunday September 17, 2023 @12:39PM (#37546936)
I'd love if interfaces worked as in typescript.

As long as the object signature matches the interface as parameter then you can use it.

Re:Java 21 makes me like Java again by owlstuffing on Sunday September 17, 2023 @11:31PM (#37551914)
Check out project manifold, it’s a compiler plugin for Java. Among other amazing features it adds structural typing [1], which is essentially interfaces typescript interfaces.

1. https://github.com/manifold-systems/manifold/tree/master/man...