[squeak-dev] Re: A little puzzle

Sean P. DeNigris sean at clipperadams.com
Fri May 15 15:34:26 UTC 2015


Stéphane Rollandin wrote
> But actually, I think I just found a workaround: throw an exception, 
> such as Abort which by the way seems to be unused.

I would strongly advise against this. Firstly, exceptions are conceptually a
way to indicate a condition that is... exceptional! So in that sense it's
confusing. But maybe more importantly, I've encountered several areas in
Pharo where exceptions were hijacked in this way and it led to lots of pain.
The one that comes to mind first is the mechanism to show progress during a
long operation. Because exceptions were used inappropriately, only one
interested party would be notified, and then they would swallow the
exception. The appropriate technique in that case was an observer pattern,
now implemented with announcements. I encourage you to find a corresponding
pattern!



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/A-little-puzzle-tp4826352p4826529.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.


More information about the Squeak-dev mailing list