Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Writing good comments is at least as hard as writing good code. Bad comments can be worse than bad code. Comments can give the reader the impression that they understand the code without the need to actually read and understand the code. If the comments are good, that's fine. If the comments are bad that can lead to a great deal of wasted time and frustration.

Don't get me wrong. Comments are an important part of writing good code. But it is better to write good code that speaks for itself than to write a translation of the code into some semblance of English (or whatever language is appropriate).

Good comments convey the intent of code and may explain how a tricky algorithm works, but doesn't give a blow by blow description of the code.

Modules provided by CPAN are written by people of vastly varying ability and can demonstrate code on many different levels, but few of those modules are written for their educative value. "Dumbing down" a module so that it is accessible to learners doesn't help CPAN and doesn't actually help learners. For one thing, there are much better ways to learn Perl basics (PerlMonks for a start), and for another: learners don't stay learners for ever, so what level should the comments and code be aimed at?

Comments in code for CPAN should be designed to ease the job of maintenance programmers. Generally that means few comments and much thought given to appropriate coding, identifiers, documentation and test suites.

That is not to say either that there isn't a lot to be learned from reading CPAN code. There is a great deal that can be learned from examining CPAN code. But you shouldn't expect it to be entry level stuff.


Perl's payment curve coincides with its learning curve.

In reply to Re: Why no comments? by GrandFather
in thread Why no comments? by targetsmart

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (7)
    As of 2019-10-18 21:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?