develooper Front page | perl.perl5.porters | Postings from August 2008

Re: [PATCH] Add open "|-" and open "-|" to perlopentut

Thread Next
From:
Tom Christiansen
Date:
August 26, 2008 10:47
Subject:
Re: [PATCH] Add open "|-" and open "-|" to perlopentut
Message ID:
32489.1219772823@chthon
In-Reply-To: Message from "David Nicol" <davidnicol@gmail.com> 
   of "Tue, 26 Aug 2008 10:29:09 CDT." <934f64a20808260829l1883609flbba03e272c6f94d@mail.gmail.com> 

> on grep and map:  I always use curlies around the expression, doing it
> that way is easier than learning when I don't have to (I honestly
> don't know what the exact rules are 

I can make it even easier: there are no rules.

>on &apos; vs. &quot; : I will single-quote noninterpolated strings out
>of a possibly mistaken belief that it saves the nanosecond or two it
>would take the optimizer to do that for me.

By that peculiar impulse, you should never use curlies around a map or a grep, 
since they produce 3 lines of output from B::Concise that omitting them saves.

For that matter, you'd better skip comments, too.  Faster that way.

This is a slippery slope of silliness down which you'd probably 
prefer not to slide.

Remember that this is an *ordered* list of goals, with higher 
priority awarded the earlier that goal occurs:

    1. Correctness
    2. Maintainability
    3. Efficiency

>Sometimes it is one way and some times it is the other.

> I'd like to see the documentation in question unaplogeticly contain a
> messy ad-hoc mix of quoting styles, which is what one does in fact
> encounter "in the wild."

Matter of apoplexy aside, I question how much you'd enjoy reading a
programming textbook where the same word was at times spelt one way, 
but at other places, she spelled it differently?  What would that say 
of the state and consistency of its author's mind, or of his careful 
attention to critical programing detail?

There's great benefit in providing a consistent model for people to look up
to and to learn from, and rather less in providing an inconsistent one.  As
foolish inconsistencies are  said to put little minds at risk of spending
all their time worrying about matters of little import, it seems not just
unwise, but also unkind to do so.

--tom

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About