throw new DumbCodingException

digg this!| | Comments (0) | TrackBacks (0)

I came across the dumbest code I've seen in a while at work today.

try
{
    return _Collection.Length;
}
catch (NullReferenceException)
{
    return 0;
}


I found it because when debugging an asp.net page, I had enabled thrown exception breaks and this code was causing about 5 debug breaks for every page load...  Needless to say it has now been rewritten.

0 TrackBacks

Listed below are links to blogs that reference this entry: throw new DumbCodingException.

TrackBack URL for this entry: http://juxtaposition.axley.net/blog-bin/mt-tb.cgi/2284

Leave a comment

March 2011

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

«« December 2010

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Archives

Contact: Jason Axley

Search Amazon:

Amazon Logo
Powered by Movable Type 4.1