3 ms·
Yeah, it's only a brief crack at adding some syntax which would add some more functionality to a known statement. In short, I've used switch many times and thou
by samuellevy 14y ago
Yeah, it's only a brief crack at adding some syntax which would add some more functionality to a known statement. In short, I've used switch many times and thought to myself "Why can't I just tell it to start re-evaluating the cases again?".
The example there isn't what you would expect to find in the real world (instead it's a very cut-down piece of code to show how it would flow, and show of the main points of my thinking). That being said, the switch statement tends to be difficult to read in general, and is frequently misunderstood by new coders. I remember that when I started learning to program, I just expected it to work like this already, and was confused as to why I couldn't just change the variable I was checking and trigger other cases.