Full stack web dev.
Studying FP web development approaches, while helping Mission Bit create paths to programming for underserved public school kids.
Previously @ Gradescope.
A switch indicates that you are mapping from an input value to a piece of code.
IMO when there's fallthrough, you're not mapping from values to code, but rather values to an offset in code. Like a jump table. I mention it not because I consider it to be all that dangerous but because in those languages it waters down the idea of switch-as-map.
But I agree on the whole. Often pattern matching is what you want (or the repeated application of a predicate, a lacondp), and switch isn't always a perfect fit, but where it works it tends to be more explicit than the alternative.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
IMO when there's fallthrough, you're not mapping from values to code, but rather values to an offset in code. Like a jump table. I mention it not because I consider it to be all that dangerous but because in those languages it waters down the idea of switch-as-map.
But I agree on the whole. Often pattern matching is what you want (or the repeated application of a predicate, a la condp), and
switch
isn't always a perfect fit, but where it works it tends to be more explicit than the alternative.