Your question begs another question - what is your audience? If you contributing to a specific project, you may find that it has its own guidelines or rules, so it would therefore be a good idea to enquire. If, on the other hand, you are writing for yourself, write it in such a way that you can read (and understand) it when you come back to it later.

Personally, I cannot understand why so many insist on 80 column lines. How many programmers nowadays still use 80x24 terminals? As I write stuff primarily that nobody else will see, I tend to use 132 column lines. This is perfectly readable in gvim on my 21 inch wide-screen monitor (and I use big fonts) and never wraps when the editor is maximised - which it always is. (And it will still print correctly on an old wide-carriage dot matrix printer ;-)

I also use a 2 column tab setting - this can keep lines to a more sensible length when there are many levels of indent.

To conclude, I'd say work to what your audience wants/expects and if that audience is just you, go with what you are comfortable with and what suits your monitor.


In reply to Re: need advice: Perl code layout, long line lengths by smiffy
in thread need advice: Perl code layout, long line lengths by resistance

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.