Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Sequential defined-or operators

by WoodyWeaver (Scribe)
on Jan 14, 2008 at 16:44 UTC ( #662311=note: print w/ replies, xml ) Need Help??


in reply to Re: Sequential defined-or operators
in thread Sequential defined-or operators

WWCD? (What would Conway Do?)

...Break long lines before an operator. That approach ensures that each line of the continued expression will start with an operator, which is unusual in Perl code. That way, as the reader's eye scans down the left margin of the code, its immediately obvious that an indented line is merely the continuation of the previous line, because it starts with an operator.

The indenting of the second and subsequent lines of the expression is also critical...they should be indented to the starting column of the expression to which they belong.

Hence, ikegami. (Although Conway likes to put the terminal semi-colon on a line by itself, to signal completion of the multi-line formula.)


Comment on Re^2: Sequential defined-or operators
Re^3: Sequential defined-or operators
by naikonta (Curate) on Jan 16, 2008 at 17:05 UTC
    That approach ensures that each line of the continued expression will start with an operator
    Another reason I support this style is the starting operators can be made inline with the assignment operator where the line begins. I don't think it's so much unusual in Perl code, at least, it's not strange for me.

    However, I still much prefer (and get used) to break long lines after the operator because the adoption of \ (backslash) usage to break long lines in Unix/Linux convention. Still, both styles sign line continuation as we don't see the statement terminator (;) until the last line of the group.


    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-09-16 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (50 votes), past polls