in reply to No Comment
Hello, my name is Nkuvu, and I'm addicted to comments...
I'm a prolific commenter, particularly in Perl. But I also know that I have to maintain the comments (usually) more often than the code itself. And it should also be noted that the people who are reviewing my code aren't Perl proficient. So I comment Perl-specific operations, to help the reviewer see what I am doing -- why is usually obvious (but documented if not). For example, if I have ($foo) = $bar =~ s!\\!/!g; I'll comment on it. Because you don't see things like this in C/C++.
It was also hammered into me throughout my university career that comments are good, lack of comments is bad. Period, no flexibility in that conclusion. But I can see all of the points that other monks have made, and resolve to comment less in the future. Most of my code is very similar to C/C++, due to the people I'm working with. And I can't assume that the person who maintains my code will be a Perl programmer.
When I started with Perl, it was to update a script written by a no-longer-present programmer. He had very poor style, with variable names like $l (that's an ell) and $x throughout the script. I could have killed for comments in his code, especially since I didn't know Perl. So I've kind of overcompensated since then.
I suppose I shouldn't admit that one of my scripts (which has a complicated algorithm) is over 50% comments...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: No Comment
by autarch (Hermit) on Apr 23, 2003 at 17:46 UTC | |
by cLive ;-) (Prior) on Apr 24, 2003 at 08:28 UTC | |
by autarch (Hermit) on Apr 24, 2003 at 14:05 UTC | |
by Aristotle (Chancellor) on Apr 26, 2003 at 03:42 UTC | |
by Nkuvu (Priest) on Apr 23, 2003 at 22:34 UTC |