About use of specific error

Alejandro F. Reimondo aleReimondo at smalltalking.net
Fri Mar 3 21:43:44 UTC 2006


Why an object must manage a situation (like
 an "exception") of other object?

The "self error:"... or "self xxx" mechanism
 fix problems to the context of incumbence.
Remember the old days when a customer
 report a problem when printing invoices
 and you browse the Invoice class to
 find and solve the problem?
Now people open the debugger...
 jump on the stack and "add code" anywhere...
 something is going wrong.

The use of exceptions let problems move
 outside the object of incumbence promoting the
 diffusion of emergences through the system (to
 other objects) & in the stack (to other levels
 of abstraction).

This difusion of emergences can only be tolerated
 on formal systems (written in any OOL), but not
 on organic & open systems like any smalltalk
 ambience.

The addition of exceptions to objects follow the
 same path that defining smalltalk as a language...
 you can agree on this pov, but there are other forms
 of using smalltalk...

In smalltalk we have exceptions AND other
 mechanisms; anyone can change and add
 other mechanisms according to local
 convenience. This situation can´t occur in Java
 world because people only want better exceptions
 (one solution for all).

best,
Ale.


----- Original Message ----- 
From: "Peter Crowther" <Peter at ozzard.org>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Friday, March 03, 2006 5:50 PM
Subject: RE: About use of specific error


> From: stéphane ducasse
> In Java you
> get really a lot of exceptions everywhere. The comparison is
> interesting.

Java has had exceptions since the language was devised.  In Smalltalk, and
especially in Squeak, exceptions are recent additions.  I suspect the reason
that Smalltalk error handling has grown up the way it has, with variants of
methods that don't throw the exception, is because error: didn't give the
option of handling the problem - your code simply failed.  A Squeak
exception hierarchy has not been constructed because we're still moving over
from a 30-year-old legacy of throwing the user into the debugger rather than
handling the exception somewhere in the call stack.

- Peter




More information about the Squeak-dev mailing list