"Beautiful," in referring to code, may be an overuse of the word. I prefer "readable." And it isn't only Perl code that can be readable. It can be any language. There are principles that apply to all making any bit of code readable and maintainable. And does it need to be maintained by you or others (though the way my memory is going, they are one in the same).

Perl::Tidy is similar to other "tidying" programs, but I don't always agree with the author about what is tidy.

I'd read the thousands of links out there on coding practices, Perl and otherwise (you'll often see Perl badgered for it's tendency to be poorly written).

Then use those, plus a hybrid of what works for you and then stick to it (though I have altered certain stylistic practices once or twice in my coding career). Personally, I always try to write code that looks good on the page and that I can understand and fix months later. To write it so it is readable takes far less time than it takes to decipher poorly written code later.


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

In reply to Re: Beautiful Perl by bradcathey
in thread Beautiful Perl by BrentDax

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.