I think the if(false == ... version is more readable. Do you agree, or have another trick you can propose?
You're doing it wrong.
false == x
returns a bool, which obviously has to be compared to true
!
if (true == (false == x)) { ...}
would be better. But that again returns a bool, so just to be on the safe side, and make your code more readable, we'd better do this:
if (true == (true == (false == x))) { ...}
. And so on. Once you start comparing booleans to booleans, where do you stop? The result will always be another boolean, and to be consistent, you have to compare that to a boolean.
Or you could learn to understand the language you're working in, and use if (!x) { ...}
, which expresses exactly what you wanted.
Which do you really think is more readable?
if (false == x) { ...}
translates to "If it is true that false is equal to x".
if (!x) { ...}
translates to "if x is not true".
Can you honestly, seriously, really say that the first form is "more readable"? Would you ever say that in a sentence? "If it is true that false is equal to x"?
It is not more readable, it just shouts to any programmer reading your code that "I don't understand if statements or boolean values".