Switch Statements Are Not Positive

No Comments

Here is my two dollars worth why people should never use a switch statement. To make this worse I am using Python that does not even support a switch/case statement just to make my point more apparant.

Lets take a general case, where

Summary
In high level software languages, using switch statements can lead to errorenous results because the require a compare. Using maps (or any other abstract data type) can improve performance of a look up table by hasing the keys giving an ideal O(1) response. Also using a lookup table means that a class can defines its own implementation and interface which requires outside objects to conform to its own standard. Therefore ….

Comments are closed.