A comment on this question: Checking if a method returns false: assign result to temporary variable, or put method invocation directly in conditional? 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
?
Why Use !boolean_variable Over boolean_variable == false
ell
- 966
- 1
- 10
- 14