3 ms·
A 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,
by SillyUsername 2y ago
A 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.