DEV Community

Discussion on: The subtle art of refactoring #1

Collapse
 
peledzohar profile image
Zohar Peled

Don't use obj != null - this approach might yield unexpected results when obj is an instance of a class that overloaded the == and != operator.
Check out my post here on how to properly test for null / not null: