我最近遇到了这段代码:
do {
if ( ! checkSomething() )
break;
// some code
if ( ! checkSomeOtherThing() )
break;
// some other code
} while(false);
// some final code
编写它的程序员,沿着"cleaner control flow"
.
在我看来,如果将原始代码重构为其他内容,它可能看起来会更好。但这种说法有任何道理吗?这个结构好用吗?