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

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



Russ Allbery <rra@debian.org> writes:

> Jari Aalto <jari.aalto@cante.net> writes:
>> I'm askinf if it is ok to to reopen such bugs based of better QA
>> aspects. Possibly by providing patches if the maintainer is busy
>> elsewhere to handle such a "minor issue" from his perspective.
>
> I have to admit that I agree with that response.
>
> For one thing, $() has had some odd behavior and odd bugs, or has not been
> supported, with some old shells.  Personally, I prefer to use one and only
> one shell script coding style that I know is portable rather than adopting
> new shell features (most longer programs are better written in something
> other than shell anyway, IMO, for maintainability).
>
> For another, `` is more widely recognized I think, and therefore more
> readable to the average developer, than $(), which looks like another of
> the many ${#-*@} line-noise shell variable expansion syntaxes supported by
> some shells.

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? 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 "&". From QA perpective in Perl's case the removal of
"&" in front of function names is encourages because it make thinks
more readable.

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 ``
- they stick to what they has "always used" because they're afraid 
  of a change (legend: "break thinngs...")
- they might not be aware of how difficult it is to dinguish ` from '.

Not everybody has eagle's sight; many have glasses to stare the tube.
These should see the doctor; get better glasses?

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

Jari



Reply to: