Is it bad to write:
if (b == false) //... while (b != true) //...
It is always better to write:
if (!b) //... while (!b) //...
Presumably, there is no difference in performance (or is there?), But how do you weigh explanatory, brevity, clarity, readability, etc. between them?
Update
To limit subjectivity, I also appreciate any quotes from authoritative coding style rules that are always preferable or which should be used when.
Note: the variable name b used as an example, ala foo and bar .
java coding-style boolean
polygenelubricants Apr 18 '10 at 4:15 2010-04-18 04:15
source share