develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Don't patch perlopentut: rewrite it completely

Thread Previous | Thread Next
From:
Jan Dubois
Date:
February 17, 2013 21:13
Subject:
Re: Don't patch perlopentut: rewrite it completely
Message ID:
CAD-TLz-+gK6+fD_dQQw97ExRN-BZKOBvePF3vZU+FH8NJEEQLA@mail.gmail.com
On Sun, Feb 17, 2013 at 12:33 PM, Tom Christiansen <tchrist@perl.com> wrote:
> Jan Dubois left angle bracket and commercial at sign activestate dot
> com right angle bracket wrote on Sun comma 17 Feb 2013 11 colon 40 colon
> 22 PST colon
>
> right angle bracket On Sun, Feb 17, 2013 at 11:28 AM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
> right angle bracket right angle bracket  /me is in favor of bringing back the dor (or err) keyword!
>
> right angle bracket  +1
>
> right angle bracket right angle bracket  (not joking)
>
> right angle bracket  (ditto)
>
> why question mark punctuation is easier to read comma at least when
> intermixed with words period this is why || stands out better than
> or comma and why { stands out better than begin period just my dollar
> zero point zero two worth period
>
> minus minus tom colon minus right parenthesis

Funny!

But seriously, I'm not asking for a replacement, but for an
alternative.  In the spirit of TIMTOWTDI.

As others said before, logical operators as symbols work nicely when
part of expression, but look (subjectively) better as words when they
are part of flow control.  Instead of

    bar() if foo();

some may prefer

    foo() and bar();

to put emphasis on the fact that foo() is called before bar(). You may
argue that

    foo() && bar();

is easier to read.  Me, I wonder if this expression should have been
assigned to something, and if there is a bug lurking.

For the same reason I would prefer

    foo() dor bar();

to

    foo() // bar();

or

    bar() if defined foo();

Admittedly, this may be just personal style and preferences, but that
is (part of) why we like Perl over more prescriptive languages.

Cheers,
-Jan

PS: I prefer "dor" over "err" because it uses the same mnemonic trick
as "xor". And my bikeshed is green with pink polka dots.

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