in reply to using switch
Your best bet is to avoid using Switch at all, especially in production code. It is very easy to introduce very hard to trace bugs and is just too fragile.
If you have a large number of possible branches use a dispatch table, otherwise, if-then-else (or ? : ).
|
|---|