<p>What are the ways to eliminate the use of switch in code?</p>

Everybody loves HUGE
```
if else
```
blocks. So easy to read! I am curious as to why you would want to remove switch statements, though. If you need a switch statement, you probably need a switch statement. Seriously though, I'd say it depends on what the code's doing. If all the switch is doing is calling functions (say) you could pass function pointers. Whether it's a
better
solution is debatable.
Language is an important factor here also, I think.