Re: Exception Names
Tom Anderson wrote:
On Fri, 27 Mar 2009, rossum wrote:
On Fri, 27 Mar 2009 11:58:20 +0000, Tom Anderson
<twic@urchin.earth.li> wrote:
InputStream.read should throw an EOFException instead of returning -1 at
the end of a stream. Checking return values for special values is
goofy C
bullshit that we shouldn't be doing in the 21st century.
It may bee goofy but it is very likely to be a whole lot faster.
Throwing and catching an exception is probably going to be a lot
slower than checking the return value.
I don't believe it for a second, and even if it is true,
It depends on the bad ratio.
No bad cases means approx. same speed.
But all bad cases will decrease performance by a factor 10 by
using exceptions instead of return values.
it's not a good
enough reason.
I agree.
But as Lew pointed out end of stream is not exceptional, so good
programming practice is also against the exception.
Arne