Happy resource wasters

| 3 Comments | 1 TrackBack

The day can't go well when it starts with such. That's really sad to see. The guy, who "used exceptions quite extensively to pass messages from the database all the way to the client", tested (no, "tested") cost of throwing exceptions in .NET on his desktop using such "test":

Sub ThrowException()
 Try
 Throw New Exception
 Catch ex As Exception
 Finally
 End Try
End Sub
With Console.WriteLine(Now().ToString("hh:mm:ss.fffffff")) of course :)

And the conclusions are amazing:

1. Modern computers are fast. Really fast. Really, really, really, really, really fast.
3. Throwing one exception won't affect performance.
4. Throwing ten exceptions (nested or otherwise) won't affect performance.
5. Throwing one hundred exceptions (nested or otherwise) probably won't affect performance.
6. Throwing one thousand nested exceptions will most definitely cause your application to perform slowly.
7. The call stack actually supports 1000 levels of recursion
8. Some people don't believe Lessons #1, #3, and #4.
9. An individual's Title does not automatically mean they have any clue what they're talking about.
If some one ever says "because it's faster," think of Lesson #1 and #9 and laugh.
That's what I call a manifest of resource wasters!

Related Blog Posts

1 TrackBack

TrackBack URL: http://www.tkachenko.com/cgi-bin/mt-tb.cgi/411

3 Comments

"Dont throw Exceptions" is an oversimplified statement. Of course it is perfectly legal to throw exceptions for error handling. That's the purpose of exceptions, and that is why they are called "exceptions" - they should be used exceptionally.

"using exceptions to quite extensively pass messages from the database all the way to the client" seems horribly wrong to me. If you are regularly using this to pass common messages between layers, not just /exceptions/, you are abusing the language design.

This is not about performance or ressource wasting, it is about gross misconception of the language basics.

I've never seen a more true comment!
9. An individual's Title does not automatically mean they have any clue what they're talking about.

I'm going to save this quote if you don't mind. I'll give you credit if I ever send it to anyone.

Yes, I'm a resource waster and proud of it :-).

Leave a comment