Positive logic

20. August, 2010

I just read another great post on Daily WTF (“Boolean Illogic“). Question: Does validation occur when the status is valid?

if (statusIsNotValid.compareTo( Boolean.FALSE ) != 0) skipValidation = false;

Another great example why you should prefer positive logic.


%d bloggers like this: