When the code flow is like this:
if(check())
{
...
...
if(check())
{
...
...
if(check())
{
...
...
}
}
}
I have generally seen this work around to avoid the above messy code flow:
do {
if(!check()) break;
...
...
if(!check()) break;
...
...
if(!check()) break;
...
...
} while(0);
What are some better ways that avoid this work-around/hack so that it becomes a higher-level (industry level) code?
Any suggestions which are out of the box are welcome!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…