What is a good rule of tub for when to use case statements versus if/then statements.
Posted on 2013-01-30
Curious about when it's best to use if/then statement versus cases statements. A couple of writeups say that it's languague dependent, but they discuss several languages and I'm specifically concerned with Korn shell scripting. Other say that if you have multiple ifelse in the if/then loop, then it's best to use case. I looking for a good rule of tub as it seems I tend to use if/then statements way too much and maybe in the wrong way where a case statement is more appropriate. Anybody?