[
Lists Home |
Date Index |
Thread Index
]
>>>>> "AS" == Alaric Snell <alaric@alaric-snell.com> writes:
AS> Well there's no fixed dividing line between exception
AS> conditions and common program flow. You could say that
AS> exceptions are only for truly exceptional conditions such as
AS> stack overflow and hardware failure, and everything else
AS> should be handled by error returns... but I think few would
AS> necessarily agree.
As I haven't seen it mentioned yet: in Eiffel an exception occurs only
when the contract is violated. I've found this a very helpful: if a
routine cannot fullfil its contract, an exception is thrown.
To me it looks like that when an entity cannot be expanded (smiley
attack), an exception is warranted, if the contract is that the
routine *will* expand. If the contract is: I try to expand, but check
is_expansion_successful, then an exception is not warranted.
--
Regards,
Berend. (-:
|