[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: use readable $(cmd) syntax instead of unreadable `cmd`



Jari Aalto <jari.aalto@cante.net> writes:

> I take your word that some old shells may have had initial problems
> with the $(), but does this hold true any more in practice in 2007?

The code I write still has to be portable, for various Stanford-internal
reasons, to Solaris 8 /bin/sh, which is... weird.  I don't know if it has
problems with this in particular, but I also don't see any good reason to
change my coding style when I know that `` works and when I know that a
lot of apparently innocuous changes *do* break on platforms that I care
about.

> If I would compare the same thing with perl that

>   &functions()

> is valid syntax as of Perl 2007, we would never change a thing move to
> remove the extra "&".

Perl 4 to Perl 5 changes are a bit of a different animal.  Perl 5 is a
completely different language; that's akin to using Perl 6 as an argument.

> From QA perpective in Perl's case the removal of "&" in front of
> function names is encourages because it make thinks more readable.

I wouldn't remove it for that reason.  I would remove it because it
*means* something different.  Using & circumvents prototypes, and using &
without the parens is magical and does something significantly different
from what one might expect.

> I agree that `cmd` is widely recognized, but the other side of the coin
> might be that in $()'s case:

> - developers may not be aware of it, so they only use ``

I don't see this as a problem.

> - they stick to what they has "always used" because they're afraid 
>   of a change (legend: "break thinngs...")

I consider this a feature.  If it's not broke, don't fix it.

> - they might not be aware of how difficult it is to dinguish ` from '.

They look significantly different on my screen.  (I recommend xfonts-jmk
and the neep font for a good fixed-width screen font.  It's significantly
more readablel than any other X screen font I've used, and it now has
reasonable Unicode support.)  It's a small character, admittedly, and is
as easy to miss as comma vs. period, but, well, Unix has a long tradition
of using lots of characters.

> Back to the point. From QA perspective does "The Debian Project" not see
> any value of encouraging $() ?

I'm afraid I don't.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: