19 points hnisjafx40 1 hour ago 3 comments

armchairhacker 42 minutes ago | parent

Java also has recursive patterns and (maybe still in preview) literal patterns: `switch (x) { case A(B(true, var c)) -> f(c); }`

Larrikin 41 minutes ago | parent

Java continues to try and catch up to Kotlin https://kotlinlang.org/docs/sealed-classes.html

I didn't mind Java when the comparisons were to C++, Ruby, and Python. I can not find a reason to go back after Scala (which seemed to fail due to being indiscriminate) and especially Kotlin

sideeffffect 13 minutes ago | parent

> Java continues to try and catch up to Kotlin

Does it, really? Java has had pattern matching since 21 (2023). Kotlin still, to this day, the year of our Lord 2026, doesn't...