Good practice : compare a value with a boolean?
- by NLemay
Most of the time, I prefer to write this :
if(isWelcome() == true){}
if(isWelcome() == false){}
instead of this
if(isWelcome()){}
if(!isWelcome()){}
Because I feel that it is easier to read (but I do understand that it doesn't make sense).
I would like to know if there is a common agreement about this practice. What most developer do? And I'm wondering if the compiler is doing the extra comparaison, or if it understand that it is useless.