Is the use of explicit ' == true' comparison always bad? [closed]
- by Slomojo
Possible Duplicate:
Make a big deal out of == true?
I've been looking at a lot of code samples recently, and I keep noticing the use of...
if( expression == true )
// do something...
and...
x = ( expression == true ) ? x : y;
I've tended to always use...
x = ( expression ) ? x : y;
and...
if( expression )
// do something...
Where == true is implicit (and obvious?)
Is this just a habit of mine, and I'm being picky about the explicit use of == true, or is it simply bad practice?