Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

(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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173576]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2017-08-23 20:33 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (358 votes). Check out past polls.