IsNothing versus Is Nothing

If you take a look at the MSIL as it’s being executed you’ll see that it doesn’t compile down to the exact same code. When you use IsNothing() it actually makes a call to that method as opposed to just evaluating the expression.

The reason I would tend to lean towards using “Is Nothing” is when I’m negating it becomes “IsNot Nothing’ rather than “Not IsNothing(object)” which I personally feel looks more readable.

Leave a Comment