News for hackers. Stuff that matters.
Re:What is the most intrusive wart on your favourite program... by RWilson on Sunday December 07, 2008 @11:58PM (#389504)
agreed, if (a) then just return a;

if (a) { return true; } is just as redundant as an if (a == true) statement.

Re:What is the most intrusive wart on your favourite program... by RWilson on Thursday February 05, 2009 @11:31PM (#469349)
Hmm... not sure what justified the -1 on this. Perhaps that in some languages if (a) can be used as a shortcut for if (a != null), where a is an object and not a boolean. So, as a correction to my previous comment. If (typeof a == "Boolean" || a instanceof boolean), I still stand by reducing redundancy, but if a is an object, then fine, if (a) return true;