Why Use !boolean_variable Over boolean_variable == false
Posted
by
ell
on Programmers
See other posts from Programmers
or by ell
Published on 2012-02-25T20:39:42Z
Indexed on
2012/11/21
17:16 UTC
Read the original article
Hit count: 346
A comment on this question: Calling A Method that returns a boolean value inside a conditional statement says that you should use !boolean
instead of boolean == false
when testing conditions. Why? To me boolean == false
is much more natural in English and is more explicit. I apologise if this is just a matter of style, but I was wondering if there was some other reason for this preference of !boolean
?
© Programmers or respective owner