In C, C++ and C# when using a condition inside a function or loop statement it\'s possible to use a continue or return statement as early as possible and g
Do not sacrifice readability for premature optimization.
For example:
void function() {
if( condition ) {
//do some stuff
} else {
//do other stuff
}
}
is in most cases binary equivalent to
void function() {
if( condition ) {
//do some stuff
return;
}
//do other stuff
}
(i.e. the resulting code is probably the same). But the readability of the former is much better, because you can clearly see that the code will to either X or Y.