Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: To parens or not parens in chained method calls

by Your Mother (Archbishop)
on Feb 16, 2017 at 04:25 UTC ( [id://1182117]=note: print w/replies, xml ) Need Help??


in reply to To parens or not parens in chained method calls

I personally prefer to remove all parens that are unnecessary for the compiler. Something else I tend to do with chained methods–

$obj->other_obj ->method; # /* I do it in JS too :P */ $.ajax({blah blah}) .done() .fail();

Replies are listed 'Best First'.
Re^2: To parens or not parens in chained method calls
by choroba (Cardinal) on Feb 16, 2017 at 09:40 UTC
    I've even met style where the indentation changed when a different object was returned:
    $object->color('red') ->width(3.7) ->child ->color('green') # etc.
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

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

    No recent polls found