Let's say you have many paths that an application can take at a certain point based on the value of a specific input (for example a simple int
). Is there a certain method that is most efficient for picking which path to follow? A nice and organized way would be a simple switch
statement, but does that scale as the number of possible cases grows larger? Is there a better method when you have, say 100 or 1000 possible cases? Assume polymorphism isn't applicable and each case has totally unique functions which cannot be abstracted further.
Most efficient method for large switch statements
thanby
- 149
- 1
- 1
- 5