switch($some_value) {
case 1 :
doSomething();
case 2 :
doSomething();
break;
case 3 :
doSomethingElse();
break;
default :
doSomething();
doSomethingElse();
}
Is there any reason why keeping things simple is not an option?
The number of possible outcomes in a switch case can often be so many that falling through would just be the route to complicated and difficult to manage code.
Is there any reason why keeping things simple is not an option? The number of possible outcomes in a switch case can often be so many that falling through would just be the route to complicated and difficult to manage code.