Re: Real life cost of using exceptions for control flow?
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/17/04
- Next message: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Previous message: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- In reply to: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Next in thread: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Reply: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 17 Jun 2004 16:02:17 +0100
<"Alvin Bruney [MVP]" <vapor at steaming post office>> wrote:
> > We've said before we'll have to agree to disagree on this. While the
> > answer is often "No", I don't believe it *always* is.
>
> No. Just say you are wrong on this.
What, say I'm wrong when I don't believe I am? Do you really *never*
catch any exceptions raised by your own code, except at the very top
level?
> Look how many million programmers now think its ok to throw a thousand
> exceptions per hour after reading this thread. And they'll be using your
> logic to justify it. And they should rightly be fired for it! You need to
> correct this, at least for the sake of keeping with convention.
If their simple design happens to fire a thousand exceptions in an
hour, but keeps the system working well, rather than using complicated
and error-prone logic to avoid those thousand exceptions, I don't
believe they *do* deserve to get fired.
> You may not necessarily find it wrong but programmers with less experience
> will follow blindly and produce misbehaved applications. There's a good
> reason why convention dictates a clear path forward. Programmers with a lot
> of experience who know what they are doing are free to bend the rules how
> they see fit because they understand the consequences. Inexperienced
> programmers need to follow convention untill they learn the reasons why
> convention is in place.
Could you explain how any of that goes against what I said about it
Bruno's approach *often* being the right one but not *always* being the
right one?
Following your "never throw any exceptions" convention blindly is just
as wrong as following a convention of "throw exceptions here, there and
everywhere". Code which has to bend a natural design into all kinds of
knots just to avoid ever throwing an exception is just as bad as code
which throws too many exceptions, in my view.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Previous message: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- In reply to: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Next in thread: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Reply: Alvin Bruney [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|