The Life of a Programmer

Why switch is better than if-else

In Ben’s post, he questions whether switch statements are cleaner than if-else chains. I contend they are, because they better express the semantics of the