Re: Real life cost of using exceptions for control flow?
From: Justin Rogers (Justin_at_games4dotnet.com)
Date: 06/18/04
- Next message: Justin Rogers: "Re: Real life cost of using exceptions for control flow?"
- Previous message: Chris: "Why is BinaryWriter.Write7BitEncodedInt a protected method?"
- In reply to: Bruno Jouhier [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Next in thread: Jon Skeet [C# MVP]: "Re: Real life cost of using exceptions for control flow?"
- Reply: Jon Skeet [C# MVP]: "Re: Real life cost of using exceptions for control flow?"
- Reply: Bruno Jouhier [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Jun 2004 11:53:22 -0700
> You should write your program so that there are no exceptions "as long as
> your program operates in normal conditions" (and bad input is one of the
I love this statement, so I'll make a quick comment. The discussion in my
opinion is getting very good since both sides of the exception camp are present.
However, the above statement draws our differences. You see, as a WinSock
programmer, I know that a lost network connection is not an exceptional
circumstance. It just isn't. The reliability and quality of service present on
a
single land line, DSL connection, and on all network connections between two
hosts is fragile at times. A dropped connection is a *normal* program occurence
and in many cases is something you have to respond to IMMEDIATELY.
Communications code is very privy to this type of issue. At times, a
concurrency
protocol will require conversions and other things happen within small windows
of 10-15 ms. Dropping the network connection and getting an exception eats away
my window. If I am a reliable programmer, the second connection was already up
and redundant probably through some extra set of host adapters on a different
physical connection, which I switch over to and continue my concurrency protocol
without interruption.
Whether or not something is exceptional is up to the programmer. Especially for
spurious exceptions like out-of-space on the disk. A reliable programmer sets
the
length of the file up front and ensures he can write as much data as he
requires.
Now a HD crashing IS an exceptional case, but most of those you pointed out,
are not, in many cases, exceptional at all.
Maybe that is why the camps are so split? The perception of exceptional is a
relative term?
-- Justin Rogers DigiTec Web Consultants, LLC. Blog: http://weblogs.asp.net/justin_rogers
- Next message: Justin Rogers: "Re: Real life cost of using exceptions for control flow?"
- Previous message: Chris: "Why is BinaryWriter.Write7BitEncodedInt a protected method?"
- In reply to: Bruno Jouhier [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Next in thread: Jon Skeet [C# MVP]: "Re: Real life cost of using exceptions for control flow?"
- Reply: Jon Skeet [C# MVP]: "Re: Real life cost of using exceptions for control flow?"
- Reply: Bruno Jouhier [MVP]: "Re: Real life cost of using exceptions for control flow?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|