Re: Invalid Operating System

[prev] [thread] [next] [lurker] [Date index for 2006/12/11]

From: A. Pagaltzis
Subject: Re: Invalid Operating System
Date: 13:18 on 11 Dec 2006
* Abigail <abigail@xxxxxxx.xx> [2006-12-11 11:15]:
> On Sun, Dec 10, 2006 at 09:03:47PM +0100, A. Pagaltzis wrote:
> > Actually, judging by the number of shell newbies who forget
> > (or just plain don't even know) to quote their variables and
> > to tell when it's necessary, I would say that the zsh guys
> > are completely correct: defaulting to word splitting is
> > broken.
> 
> Claiming the default behaviour is wrong on account of what
> newbies do is wrong.

If that were the case, you could never criticise any language's
design, so I cannot agree. I'm not saying the zsh project's
decision to "fix" the language is right, I only agree with them
that it's broken.

I don't draw that conclusion because of newbies; I draw it
because when I write shell scripts, at least 2/3s of my variable
interpolations are within doublequotes, and at least 2/3s of the
rest *could* be without breaking the script. Only in a very small
number of cases do I specifically want word splitting; yet it's
the one behaviour I get if I don't explicitly say otherwise.

The newbies are a particular concern because when you need to
write make-work code every time you do a common task, they are
not going to know it; and the more advanced people will often be
too lazy. (Just like using placeholders vs interpolating
variables in SQL strings in PHP.) That doesn't mean it's
a feature: those who know better just write more make-work code;
they don't actually gain any advantage from the broken default.

> That's like saying Ferrari got it wrong because how newbie
> drivers drive.

You're not seriously saying sh is a Ferrari, are you? C is
a Ferrari, maybe. sh is just an early-generation Japanese car.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>;
There's stuff above here

Generated at 22:02 on 27 Dec 2006 by mariachi 0.52