http://www.perlmonks.org?node_id=662311


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!