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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
BrowserUk,
95% of the code I develop is written for monks here at the Monastery or for strangers on #perl in IRC. I almost never comment code and very rarely receive questions as to how the code works. I think this because of a handful of reasons:

  • I use variable names that aid in understanding the code
  • I use function names that aid in understanding the code
  • I present the code in small digestible chunks
  • The person reading the code already knows what it is supposed to do and only has to figure out how

There are a few instances when it has been necessary to comment my code. This is either because the approach to solving the problem is not obvious to the individual seeking assistance or because their level of competency warrants them.

This is not to say that everyone reading the thread is able to understand it as there are rare occasions when clarification is requested. The best example of my own commented code I could find was that of Perl6 and are probably mostly superfluous due to the text description, which is what POD is for afterall.

Cheers - L~R

While my one public module is documented using POD, it does not contain comments.

In reply to Re: The art of comments: (rave from the grave) by Limbic~Region
in thread The art of comments: (rave from the grave) by BrowserUk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-20 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found