On Tue, Feb 20, 2001 at 08:33:50PM -0500, Bryan C. Warnock wrote:
> On Tuesday 20 February 2001 19:34, Edward Peschko wrote:
> 
> > Well, for one, your example is ill-considered. You are going to get 
> > autovivification saying:
> 
> The two ideas were disjoint.  The example wasn't an example of autoviv.

well, I was thinking you were saying @foo[$bar] = 100;

> > Hence I'd say that @foo[$bar] has NO INTRINSIC VALUE whatsoever.
> 
> Correct, which is why I could care less if Perl warns me about it.

right, but which is the higher cost? 10 experienced people being inconvenienced
because they see a message they can easily avoid, or 10000 people learning the
language not getting the benefits that they would otherwise get by seeing it.

If perl is squawking to you about something, it usually is because you've got
a misconception of some kind. In this case, the misconception is that something
like:

if (@tmp[1,4] == @tmp[2,5])
{
}

will work.

> > Second, with the keyword empty (if it comes to pass) the reasons for 
> > interpretation of undef as 0 and "" go away. Right now, things are a PITA 
> > to get empty values:
> > 
> > my ($a, $b, $c, $d, $e) = ('') x 5;
> 
> I *like* the interpretation of undef as 0 and "".  It's useful.  Sometimes.
> Sometimes it's not.  And that's fine.  

No that's NOT fine. It leads to 'find the needle in the haystack' sort of 
problems. If you get 1450 'use of undef value' errors, they are all useless.

If you get 10 of them, and you know that the only time you are going to get
'use of undef value' errors, they are very valuable. And how valuable they 
are grows as the size of your project increases.

> There's no reason in the world why that should replace undef -> 0 and "".

See above.

> > Or how about "I'm feeling particularly lazy today, I think I'll sleep in. 
> Lets
> > worry about any mistakes I might make another day."
> 
> Well, Laziness is One of the Three.

Exactly. Perl lets you be as lazy as you want. It just shouldn't do it by 
default, because warnings and strict are great teaching tools.

> Let me rephrase.
> Perl shouldn't bitch at me for valid perl.

'-q'.

Ed

Reply via email to