News for hackers. Stuff that matters.
Re:Java in the Small by Quekid5 on Wednesday December 18, 2024 @07:05PM (#42456877)
The whole switch/pattern matching thing is a true abomination borne from: Well, things in statement position can't be expressions (or however Pythonistas might phrase it), so clearly switch/pattern matching must be a statement... It's such an own goal and undermines the main point of pattern matching.

(I do realize that there was opposition on this, but that the Clearly Wrong side won out is baffling.)

Re:Java in the Small by cutler on Wednesday December 18, 2024 @08:11PM (#42457303)
Same principle behind Python's crippled lambdas.
Re:Java in the Small by nayuki on Wednesday December 18, 2024 @07:08PM (#42456908)
Yeah, it's a shame for Python. I am extremely impressed that Java 14's switch expression ( https://openjdk.org/jeps/361 ) is a generalization of the switch statement (since Java 1.0); it's like they took a page from Rust's language design. I have found the switch expression to be quite useful in my work.
Re:Java in the Small by Quekid5 on Wednesday December 18, 2024 @07:09PM (#42456918)
Probably from ML/Haskell, but yes :)