good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: The difficulties of commenting codeby eejack (Hermit) |
on Jun 29, 2001 at 07:32 UTC ( [id://92526]=note: print w/replies, xml ) | Need Help?? |
I've changed my style of commenting many times (as many times
as I have changed my style of coding).
I have found that if I write clear code and use meaningful variable names comments are fairly unnecessary. This is not to say that I shouldn't comment the code anyway, because what is clear and meaningful to me may not be to someone else. What I have found extremely handy is commenting the ends of my blocks and subroutines if they are more than a few lines apart. For me finding the ends makes life easier (and the ends normally don't change).
One thing I have stopped doing is commenting my code with poetry, jokes and completely meaningless bits. I still get my chops busted for one comment I made in the middle of a fairly routine script. # Reset Alien Receptor Beam! The guy spent an hour trying to find it to reset it...:) EEjack
In Section
Seekers of Perl Wisdom
|
|