Another construct that could help with your early out (and also heavily debated within the annals of computing time
) , is the goto statement
Personally, I don't want to see it in there....but just bringing it up
IE:
loop:
variable ?
goto earlyout;
earlyout:
/* see ya */
Quote:
Originally Posted by johanatan
Good point. Except it makes for an extra level of nesting. No biggie though I suppose.
I would like to do:
Code:
x < y ? return;
// other stuff
It would just keep the parenthesis matching a little easier for programmers/maintainers. Even a goto-label system would work, but then you could end up facilitating really intermingled code.
|