Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^15: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

by tobyink (Canon)
on Oct 11, 2020 at 21:05 UTC ( [id://11122716]=note: print w/replies, xml ) Need Help??


in reply to Re^14: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

Or:

$i < 0 and $i = 0;

In either case, no brackets, no braces, no parentheses necessary.

  • Comment on Re^15: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
  • Download Code

Replies are listed 'Best First'.
Re^16: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by GrandFather (Saint) on Oct 11, 2020 at 21:59 UTC

    I'm lazy. if is shorter and requires no translation compared to and so it's a double win. The rawest Perl newbie, or indeed interlopers from most B derived languages, should have little difficulty understanding the if variant. The and variant with its somewhat subtle use of precedence and evaluation side effects is significantly more of a maintenance burden.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
      # Original if (X) { Y; } # Postfix if Y if X; # Low-precedence and X and Y;

      Low precedence and has the advantage that it is ordered "X, Y" instead of "Y, X".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122716]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-18 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found