[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 20000111.008] use strict 'vars'



Tom Christiansen wrote:
> 
> ?Correct me if I'm wrong, but I thought the oft-repeated bug report is
> ?"use strict doesn't work for $a and $b."
> 
> "use strict" doesn't "work" for a lot of other variables, either,
> like @F and $_ and @_ and %_ and $ARGV and @ENV and $. and $!, too.
> The allegation that there wasn't enough code out there using $a and
> $b for us to care about it got the answer it deserves.


I think its interesting that most of perl's globals look like hieroglyphs.
$&  $'  $+  $*  $~  $/  $;  $"  $#  $(  $)  $[  $]  

such names have near zero chance that a neophyte would accidently stumble onto them.
how many bug reports say "use strict doesn't work for $." ???
I say someone designing perl made a bad decision from a users standpoint
when they used a global variable with a "normal" name of $a and $b.

what about changing the global to some form of hieroglyph?
$#[  and  $#]   or some such nonsense, that should avoid
anyone from accidently using it, and should keep Tom's hands
from cramping up from too much typing.  

then spit out a warning saying $a $b has been deprecated,
all code will still run, but occurences of $a $b in sort routines
will be quickly rooted out by the warning messages.



> The novice issue is a red herring, and the "all programs do work (or should
> work) the same way" was so silly I burst out laughing.  I hope you
> don't want me to answer that one, too.  The answer is self-evident.


for every exception added to perl, the more un-usable perl becomes.
I'm glad you can find humor in that.

it's generally said that perl tries to "do the right thing"
I'm simply asking the same of the perl designers.

a bad decision was made to use $a and $b as global sort variables.
why is it so outlandish to suggest it be corrected?

I'd guess there are 20 *.pm files in the perl distribution 
that would need to be updated so that their sort routines 
use the new hieroglyph. I could go through them and change 
all $a $b to their new hieraglyph in a couple of days, part time. 

why the outrage?

Greg



Follow-Ups from:
Tom Christiansen <tchrist@chthon.perl.com>
Larry Wall <larry@wall.org>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]