3 ms·
> Fallthrough allows you to run partially the same code for different inputs. True, but it's a screwy way to manage such overlaps. The volume of errors and con
by tabtab 7y ago
> Fallthrough allows you to run partially the same code for different inputs.
True, but it's a screwy way to manage such overlaps. The volume of errors and confusion exceeds the benefits in my opinion. There are other ways to do such. For non-trivial conditionals (such as overlaps), if-else is often the better tool anyhow. Case/Switch should only be used for simple mutually-exclusive value look-ups.