Steve Jenson's blog

Perl defaults considered har.. ahh, I'm sick of that already.

Perl defaults considered har.. ahh, I'm sick of that already.

A recent message on LL1 about Perl providing "sensible" default values like returning undef (which acts like an emtpy string or the number 0 in the appropriate context) when requesting the value for a hash key that doesn't exist reminds me of a passage from Lisp in Small Pieces:
Even if it were practical for implementers [of a language -smj] never to provoke an error and thus provide an idyllic world from which error had been banished, that design would still have a major drawback because the goal of a program is not so much to avoid committing errors but rather to fulfil its duty. In that sense, an error is a kind of crude guard rail: when we encounter it, it shows us that the program is not going as we intended. Errors and erroneous contexts need to be pointed out as early as possible so that their source can be corrected as soon as possible.

# — 10 August, 2002