Saturday, May 17, 2008

useless exception handling

I recently found this snippet of code in an old email. This was written by the first developer I ever had to fire

try{
if (variable ==null)
throw new NullReferenceException();
}

catch (NullReferenceException e){
throw new Exception("NullReferenceException");
}

3 comments:

Unknown said...

omg that is priceless!

Unknown said...

Was that part of the infamous exception handling "framework"? hehe

thinker said...

Maybe he had just learned about try/catch and he did not find any better way to use it or he wanted to make his code looks professional! :D:D
I could imagine how much of that framework was like this;)