I have to evaluate many conditions. In my case, I have to do something like this:
switch(id)
{
case 5:
// switch some other cases here
case 6:
// set some value
...
}
Is it good practice to have another switch in case 5? If not, what’s better? Having if statements there?
I’d call a function that was specific to case 5, then have the switch case in that function. For example :
The function specific for case 5 :