Re:If-else vs switch – Which is better?
by silvio on Sunday August 02, 2009 @10:16PM
(#738455)
For most applications, the choice between an if-ladder and a switch statement should be driven mostly by legibility and not performance. If performance is at stake, I would look for I/O first, memory access patterns second, and instruction sequencing last.
[ Parent
| on HN ]
Which is really the case for almost all such choices, and the reason that we generally favor languages with more expressive power and code clarity, rather than raw speed, except in tight inner loops.