Hi Guys,
I find myself spending far too much time wondering which one of these two methods is the best, and why?
What I am doing is using a pair of Booleans to decide which one of four actions to perform.
Method 1:
If a=0 and b=0
// Do action 1
Endif
If a=0 and b=1
// Do action 2
Endif
If a=1 and b=0
// Do action 3
Endif
If a=1 and b=1
// Do action 4
Endif
This method is neater and easier to follow, but seems kind of long winded.
Method 2:
If a=0
If b=0
// Do action 1
Else
// Do action 2
Endif
Else
If b=0
// Do action 3
Else
// Do action 4
Endif
Endif
This method is less easy to follow, but I think is a lot more efficient in that it doesn't cause the computer to evaluate so many conditions.
So I thought I'd throw it out here and see what you guys had to say? or if you had any better way of doing it which I hadn't thought of...