I've always been taught that for more than 4 or 5 conditions you should almost always use switch over if / else / else if structures. Maybe I'm wrong.
I look with alarm at the (first) link provided by Jordan, I think that if used properly, the switch should be a little faster, I don't have hard data to back it up, but you can always compare it yourself. One scenario where you should never use switch is when you need to make strict ( === ) comparisons, for example.
In any case, the fact is that this is micro-optimization, and I prefer to have a readable, pleasant (girl's style) code at a possible expense of 0.000001 seconds than ugly.
For 10-20 conditions, you should definitely use switch IMO.
source share