Checking negative of a condition
- by oym
What is the (slightly pejorative) term for checking the negative of a condition (rather than the positive which is often more readable):
e.g.
if(!someVar) {
return null;
} else {
return doSomethingInteresting();
}
instead of doing this (which is arguably more readable)
if(someVar) {
return doSomethingInteresting();
} else {
return null;
}
I vaguely remember there being a term for this; something in the same spirit as the term Yoda conditions.