develooper Front page | perl.perl5.porters | Postings from April 2010

Re: RFC: Perl manual pages -- update to follow the perlstyle.pod guidelinesDate: Mon, 5 Apr 2010 11:36:15 +0000 (UTC)

Thread Previous | Thread Next
From:
Jari Aalto
Date:
April 10, 2010 02:15
Subject:
Re: RFC: Perl manual pages -- update to follow the perlstyle.pod guidelinesDate: Mon, 5 Apr 2010 11:36:15 +0000 (UTC)
Message ID:
87eiinzn0x.fsf@jondo.cante.net
Raphael_Manfredi@pobox.com (Raphael Manfredi) writes:
> Quoting "H.Merijn Brand" <h.m.brand@xs4all.nl> from ml.lang.perl.porters:
> > I use both. Tom uses parens and ||, and Jari uses or. Lets keep the
> > versatility in the docs. The current docs are not wrong.
>
> I think documentation should not be versatile, otherwise newcomers are going
> to wonder why one has to use "||" and when "or" is preferable.  Seeing both
> used in different contexts could even lead people to believe they are fully
> interchangeable, at will.  Which is not true.
>
> Personnally, I've always disliked "and" and "or" and never used them.
> I prefer to put parentheses to delimit the argument list visually, so the
> precedence never bites me.  Also I prefer to see arithmetical and logical
> operators stand out as punctuation signs (i.e. be non-words).
>
> Would you like to have things like "plus" and "minus"?
>
> 	$a = 1 plus 2;
>
> Very readable as a sentence, awful as a programming statement.

I wouldn't consider that example comparable. The "logical operators" are
a different mathematical concept from basic operations like "+ - / *".

Compare:

    truth OR truth
    expression PLUS expression

From the math background in elementary school, you're already versed
with:

    1 + 2 / 3
    a == b  OR  a == b

But not per se to start with:

    1 plus 2 divide 3
    a == b ||  a == b

The invention of "||" is due to artificial languages like "C" which have
taught league of programmers to "see" it in a certain light and
interpret is accordingly.

It's different, when your first language does not have "||". Or when the
language has both and you have to pick one to be your major tool
(compare to ISO C++).

Jari


Thread Previous | 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