Rod Adams skribis 2004-12-18 14:55 (-0600):
> Considering that "proper" and common usage, not to mention strictures, 
> dictates a heavy insistence on 'my'. I will thus assume that creation of 
> lexical variables with 'my' far out numbers the creation of package 
> space globals. Should we not then have it where it's the default 
> behavior, and creation of package ones take explicit declaration (via 
> 'our')

No.

Some other languages, including Ruby, do this. I dislike it. The best
thing about strict is that it catches typos. With automatic declaration,
you loose typo checking, or solve it in an ugly manner by requiring
assignment (which is still declaration, just with different syntax).

Just typing "my " before the first use of a variable isn't hard, and it
makes things much clearer for both the programmer and the machine. For
the programmer, because you immediately see what some variable's scope
is, and for the machine because it no longer has to guess whether
something's a typo in order to warn you ("used only once" is not always
a typo).


Juerd

Reply via email to