Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

(ichi) Re: Am I over-commenting my code?

by ichimunki (Priest)
on Jun 11, 2002 at 17:20 UTC ( #173576=note: print w/ replies, xml ) Need Help??


in reply to Am I over-commenting my code?

Where are the code comments? I see a large block of commented text that would work better as POD, but not a single comment in the code itself. I like to have this interface documentation to POD so that your module can be 'perloc Module'ed by users. Given that the code is fairly dense (although not inscrutable), you might consider a note here and there about what is going on.

FWIW I like the "Code Complete" method for generating correct code comments. Outline the procedure in English (or Latin or Klingon or German). Turn all those simple English statements into comments. Then write the code that does what the English states needs to be done. If one of those English steps is too complex to be done in five to ten lines, consider repeating the process for this piece of the routine.

This method has the advantage of forcing you to outline your code *before* writing it-- which means that problems will become apparent before you write a single line of code. It also means that meaningful comments will be right there.

Well, that's my two cents, anyhoo. YMMV. :)


Comment on (ichi) Re: Am I over-commenting my code?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-07-10 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (206 votes), past polls