C# Programming
05-21-2010, 06:50 PM
I have a senior developer that consistently checks for null after initializing an object...
CustomObject tmp = new CustomObject();
if (tmp == null)
{
throw new NullReferenceException();
}
I personally don't see the need to do this. Can anyone explain if this is a good/bad/old practice?
Thanks in advance.
CustomObject tmp = new CustomObject();
if (tmp == null)
{
throw new NullReferenceException();
}
I personally don't see the need to do this. Can anyone explain if this is a good/bad/old practice?
Thanks in advance.