When I first started developing, the only conditional I used was if/else. A few years later, I learned about switch/case and started using it for every conditional that could be done with switch/case, falling back to if/else for situations where switch/case couldn’t be used.
About four years ago, I learned about dispatch tables and I’m going bonkers with it. I would be using dispatch tables in my professional work, but no one else here wants to use them, so I stick to switch/case and if/else just because no one else wants to know about them and I have to keep my code so that anyone can work on it. (heavy sigh).
What is your preference?
- dispatch table
^ _ ^