About use of specific error
Markus Gaelli
gaelli at emergent.de
Fri Mar 17 10:05:49 UTC 2006
On Mar 17, 2006, at 3:57 AM, nicolas cellier wrote:
> However Markus, defensive programming is just a style, not a bad
> style, but
> not the only one and not the most adequate in every case. There are
> many
> cases where optimistic programming is better, when failure cases
> are so
> unprobable that it would be a waste of time to repeatidly test costly
> assertions (also better regarding volume of code). Exceptions find
> their
> place here.
If you prefer corrupted data in your database over a a slower or
error throwing program (*) you could always switch off the assertions
in your production system later without any loss of performance:
http://www.whysmalltalk.com/articles/bykov/HitchHiker.htm
Implemented/ported by Romain Robbes:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-March/
075327.html
Cheers,
Markus
(*) You might be in a project phase, where your project leader
politically prefers bad data in the db than walkback screens in the
face of the end users.
At least I experienced such kind of a project once... ;-)
More information about the Squeak-dev
mailing list
|