About use of specific error
Alejandro F. Reimondo
aleReimondo at smalltalking.net
Sun Mar 5 11:57:45 UTC 2006
> Indeed, I think that this was with the vision that Java was a
> language for internet (wild and unknown area) that lot of exceptions
> introduced and stressed.
The lack of contexts promotes the use of exceptions
as a(the only) mechanism to act outside current method.
Ale.
----- Original Message -----
From: "stéphane ducasse" <ducasse at iam.unibe.ch>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Sunday, March 05, 2006 8:28 AM
Subject: Re: About use of specific error
> >
> > Obviously you *could* do that and if you wanted to explicitly
> > handle a case of the key not being found in your collection it
> > might be the best thing to do. An 'ifAbsent:' block is great when
> > there is a simple failure case and a simple failure response. I
> > don't think it is so useful when things get more complex and there
> > are many possible problems to handle.
> >
> > For an in-memory OrderedCollection, at:ifAbsent: is extremely
> > useful and since pretty much the only thing that can go wrong is
> > the index being outside the collection bounds it covers the problem
> > nicely. For a caching collection hiding a connection to a database
> > I suspect that there are more things that can blow up and more
> > nuanced responses that one would like to provide.
>
> Indeed, I think that this was with the vision that Java was a
> language for internet (wild and unknown area) that lot of exceptions
> introduced and stressed.
>
> Stef
>
More information about the Squeak-dev
mailing list
|