Exceptions in unmanaged C++ were totally broken, for several reasons...

They are far less broken, in .NET... yes, by all means, throw!

But don't go overboard with them.  Throw statements are still rather
expensive, performance-wise.

Cheers,
-Shawn
http://www.windojitsu.com/


-----Original Message-----
From: Chris Snyder [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 06:30
Subject: Exceptions in Constructors

I have a (hopefully) simple question.

In a nutshell, as a C++ developer, various people hammered into my brain
that throwing an exception in a constructor (whether intentionally or by
performing some action which would cause an exception to be thrown) was
extremely bad. However, my research seems to indicate that .NET handles
constructors differently, allowing developers to perform actions in a
constructor that may result in exceptions being thrown, or to <gasp> even
throw an exception themselves.

Thoughts?

Thanks a lot,
Chris Snyder

===================================
This list is hosted by DevelopMentorR  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to