3 ms·
1. Every 'if' statement has a matching 'else' (exception: simple error I've always considered this a best practice. There's rarely a good reason not to have
by mindcrime 8y ago
1. Every 'if' statement has a matching 'else' (exception: simple error
I've always considered this a best practice. There's rarely a good reason not to have a matching else, even if it's no more than a comment reading
// intentional NOP
or
logger.trace( "THING didn't happen, ignoring." );
Either one tells anybody reading the code that the else case was thought about and handled the way it was for a reason.