Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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.)

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://662311]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-07-26 19:29 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (400 votes). Check out past polls.