Are switch cases outdated?

No, switch statements are not generally used wrong . It’s more readable then a long if/else chain, compilers can emit very efficient code if the checked values are reasonably contiguous, and it’s easier to write error-checking compilers that warn you when you forget an alternative.

Read more

Are switch cases outdated?

No, switch statements are not generally used wrong . It’s more readable then a long if/else chain, compilers can emit very efficient code if the checked values are reasonably contiguous, and it’s easier to write error-checking compilers that warn you when you forget an alternative.

Read more