The first issue I'd like to raise is with item #3, "Package variables in all caps". All-caps usually denotes constants. While package variables are usually constants, they are not always so. To use all-caps for something that isn't a constant will confuse your code's readers. I have yet to find a method of identifying non-constant globals with which I'm happy.

By the way, do you mean "global variables" when you say "package variables"? It's possible to have global variables that are lexicals rather than package variables.

I also have a commment about "aref_". I find the sigil+pluralization already disambiguates references from non-references. For example, consider $pearl vs $pearls vs @pearls. The first is an object, the second is an array ref, and the third is an array. True, they look rather similar. But then again, the last two are quite similar, and anyone who reads English can immediately recognize the difference between the first two without even thinking. Granted, there are time where I may wish to disambiguate a variable's content, but I find it a step backwards to require prefixes such as "aref_".

Finally, I also agree with QM's comment and Forsaken's comment to the last word.


In reply to Re: coding rules by ikegami
in thread coding rules by punkish

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.