Re: What c.l.py's opinions about Soft Exception?



Lie wrote:
[ ... ]
Soft Exception
What is "Soft Exception"?
Soft Exception is an exception that if is unhandled, pass silently as
if nothing happened. For example, if a variable turns into NoneType,
it'll raise Soft Exception that it have become NoneException,
programmers that wants to handle it can handle it with a try...except
block while programmers that doesn't care about it (or know it won't
be a problem to his code) can just leave the code as it is.

Soft Exception differs from Hard Exceptions (the regular Exception) in
a way that Hard Exception must be handled at all cost or the program
will be terminated while Soft Exception allow programmers not to
handle it if they don't want to.
[ ... ]
Ideology Base:
- EAAP: Easier to apologize than to ask permission.

Sort of like a COME FROM statement. Drastic effects on program execution: a `raise SoftException` in the middle of a loop would break the loop if a catcher existed, or leave the loop running if not. It would really need the ability to resume after catching an exception. You can't really talk about 'apologize' around something that's so irreparable.

I'd try for this effect by creating a class of objects with well-defined callbacks.

Mel.
.



Relevant Pages

  • Re: What c.l.pys opinions about Soft Exception?
    ... Exception can be added to the language silentlyso that new ... programmers doesn't _need_ to know about it (although knowing it could ... Soft Exception is an exception that if is unhandled, ... clumping be done on force calculation level, ...
    (comp.lang.python)
  • What c.l.pys opinions about Soft Exception?
    ... What is "Soft Exception"? ... Soft Exception is an exception that if is unhandled, ... programmers that wants to handle it can handle it with a try...except ... Exception can only be handled by codes above it while Event-based ...
    (comp.lang.python)
  • Re: What c.l.pys opinions about Soft Exception?
    ... > Soft Exception is an exception that if is unhandled, ... highest level, then filtering which exceptions would be stopped (Soft ... execution continues as if the 'raise' never happened. ...
    (comp.lang.python)
  • Re: What c.l.pys opinions about Soft Exception?
    ... What is "Soft Exception"? ... Soft Exception is an exception that if is unhandled, ... programmers that doesn't care about it (or know it won't be a problem to ... The cost of explicitly silencing exceptions is tiny, ...
    (comp.lang.python)
  • Re: Question concerning object-oriented programming
    ... there has usually been a toString. ... I would prefer an exception thrown. ... Actual programmers are supposed to write code that verifies input. ... Educated middle-class people learn how to use language to ...
    (comp.programming)