Same wiht If's :huh:Quote:
with a switch there are a set of valid values, and that's all, and you can make a default action.
But if it's faster then go for it.
Printable View
Same wiht If's :huh:Quote:
with a switch there are a set of valid values, and that's all, and you can make a default action.
But if it's faster then go for it.
Using a switch statement instead of nested if-else statements is just better programming. It results in better looking code and should be more efficient, but not to the degree that it would actually be noticable for such a small program.