[Haskell-cafe] Re: Exception handling in numeric computations

Gregory Petrosyan gregory.petrosyan+haskell at gmail.com
Fri Mar 27 13:38:52 EDT 2009


On Fri, Mar 27, 2009 at 7:31 PM, Donn Cave <donn at avvanta.com> wrote:
> Quoth John Lato <jwlato at gmail.com>,
>
>> An exception is caused by some sort of interaction with the run-time
>> system (frequently a hardware issue).  The programmer typically can't
>> check for these in advance, but can only attempt to recover after
>> they've happened.
>>
>> An error is some sort of bug that should be fixed by the programmer.
>
> I have never felt that I really understood that one.

Me too :-)

BTW, John, how often do you encounter _hardware_ issues compared to "errors"?

Is an "out of memory" thing an error or exception?
You will say "exception, for sure", wouldn't you? :-) And if it is a
result of applying
known-to-be-very-memory-hungry algorithms to non-trivial input? Looks like
programmer's error, doesn't it?

And I think I can provide lots of similar examples.

If there exists separation between errors and exceptions, it should be
very strong
and evident — otherwise "casual programmers" like myself will need to
stare at the
ceiling every time they write something to decide what suits best.

        Gregory


More information about the Haskell-Cafe mailing list