On Oct 2, 2006, at 10:26 AM, jerry gay wrote:
On 10/2/06, Jonathan Lang <[EMAIL PROTECTED]> wrote:
I'm not used to programming styles where a programmer intentionally
and explicitly forbids the use of otherwise perfectly legal code.  Is
there really a market for this sort of thing?

use strict;

The advantage of "use strict" is that it is purely advisory. If you're about to do something sleazy and you know it, you can always use the escape hatch of "{no strict; ... }".

Any such restrictions that a coder places on future users of his code or template should also be advisory. One big advantage of Perl 5 is that there is an advisory class structure that can be overridden in cases of extreme need, even when the original coder clearly intended that you never override the interface. (an example is DBI, which wraps its objects up inside tied hashes simply to prevent access to the inside by less-than-determined coders)

Restrictions are useful for code style control, but mainly as markers: "Here be dragons", or whatever. For the case of someone who wants that (Jonathan's words) "any declaration of method 'm' that doesn't conform to this signature should be illegal", it should be possible for the method coder to override that restriction by taking some explicit action in the source. Otherwise we'll have the programming equivalent of evil no-fast-forward previews on DVDs.

Reply via email to