Testing nullity (if (value == null)
) or non-nullity (if (value != null)
) is less verbose than testing the definition status of a variable.
Moreover, testing if (value)
(or if( obj.property)
) to ensure the existence of your variable (or object property) fails if it is defined with a boolean false
value. Caveat emptor :)