P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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... In reply to Re: No Comment
by Nkuvu
|
|