3 ms·
Which is why programmers who know these features from languages like Rust hate these. Except, they don't. Whenever I do something in a neat, elegant match-stat
by Freak_NL 2y ago
Which is why programmers who know these features from languages like Rust hate these. Except, they don't.
Whenever I do something in a neat, elegant match-statement in Rust, going back to a language which lacks these is painful. This isn't bloat, it's keeping up with the times.
- SillyUsername 2y agoA better picture would be to do away with switch entirely. It's unnecessary with the options I mention above and code folding. It's should go the way of goto, which also happens coincidentally to be a way of using labels (fun off topic fact goto is a keyword in Java as pre 1.0 it was represented in bytecode). Nb arguing that it also prevents excess code is somewhat moot, the Java community for better or worse favours anemic models full of empty setters and getters, that is probably a more important area to address than just introduce a new record type to avoid these.