What do you mean by "document the hell out of your subroutines"?

Pick up The Pragmatic Programmer or Code Complete, and read what they have to say about comments. As long as you expect to have separate documents for the maintainer and the computer, you are doing something wrong. Document the interface, not the code. Make the code its own comment. (Good variable and function names really helps. So do well-written messages in your error checks.)

My second point is references. Don't use references because they are cool - OK I can buy that. But don't go out of your way to avoid nested data structures either. (Which happen to use references.) Gratuitous abuse of references is bad, but so is the gratuitous abuse of virtually any other feature. Why single out references?

Other than those two nits I think you are spot on.

A final point that is too often forgotten. There is nothing wrong with not knowing something. Programming is a field that is constantly changing and you will constantly be dealing with things you don't know. So if you have any questions at all, check the documentation and if you cannot figure it out, start asking questions.

Not knowing is expected. But if you are not learning then you have a problem.


In reply to RE: My philosophy on coding (in Perl and other languages): by tilly
in thread My philosophy on coding (in Perl and other languages): by mrmick

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.