So, let's assume I wanna make a system that will decide something, according to some things that occur.
Let's say we got 11 Events.
There might be 3 things possibly happening to each of them.
What happens to the first, will determine what happens on the second. What happens on both first and second will determine the third and so on till let's say 11.
A lot of complex calculations is going on.
Since it is three things that can happen, I can have either 11 variables with conditional branches for value 1, 2, else.
On the other hand, I can use 33 switches to determine what will happen.
Consider spaghetti code not significant.
Consider 33 switch hardship and complexity not significant.
What will be the best approach to make this, to retain as much performance as possible?
33 Switches or 11 variables?
Let's say we got 11 Events.
There might be 3 things possibly happening to each of them.
What happens to the first, will determine what happens on the second. What happens on both first and second will determine the third and so on till let's say 11.
A lot of complex calculations is going on.
Since it is three things that can happen, I can have either 11 variables with conditional branches for value 1, 2, else.
On the other hand, I can use 33 switches to determine what will happen.
Consider spaghetti code not significant.
Consider 33 switch hardship and complexity not significant.
What will be the best approach to make this, to retain as much performance as possible?
33 Switches or 11 variables?