In some code I'm writing right now, I have something like this:
if (uncommon_condition) {
do_something_simple();
} else {
do();
something();
long();
and();
complicated();
}
Part of me thinks "It's fine the way it's written. Simple cases should go first and more complicated cases should go next." But another part says: "No! The else
code should go under the if
, because if
is for dealing with unusual cases and else
is for dealing with all other cases." Which is correct or preferable?