Warning: religious zealotry ahead
        
On Jul 1, 2009, at 3:20 PM, Sean Owen wrote:
3.and "== true" is redundant, etc.

You will have a really hard time convincing me that == true or == false instead of !varName is redundant, despite the fact that I know it is syntactically. I've been burned too many times by staring at code (both my own, back when I subscribed to said shortcut, and others) at 2 in the morning after hours of debugging some problem to not be a strong believer in using syntax options (whitespace, == true or == false, etc.) to make developing more clear cut.

Imagine reading the following after a long day and being really tired (my old tired eyes can barely make out the difference now and it is mid-afternoon:

if (!length){
 ...
}

instead of

if (length){
}

versus:

if (length == false)
or
if (length == true)

In fact, I explicitly turn off this warning in IntelliJ.

So, in other words clean it up all you want, but it's just going to be back in there with the next piece of code that I happen to write. :-)

-Grant

Reply via email to