|
From: | address@hidden |
Subject: | Re: Uncommented code in LilyPond |
Date: | Tue, 4 Sep 2012 08:49:15 +0200 |
On 3 sept. 2012, at 17:34, David Kastrup <address@hidden> wrote: Janek Warchoł <address@hidden> writes:On Mon, Sep 3, 2012 at 1:00 PM, Graham Percival Hey all, I started doing commenting in accidental.cc and accidental-engraver.cc. I found myself in the pattern of: looking at a variable with a name (like a boolean called done_) going down into the code to find out what done_ means going back up to put a comment next to done_ Or: looking at a function reading what it doesgoing above the function to write a resume of what it does What has been good about this exercise is that I've found a bit of cruft that can be deleted and a couple minor speed-ups possible. However, I still don't understand the utility of more comments in these two files after all of this. Note that I am not calling into question what David is saying about comments - I'm sure he is right. It's my failing to understand why they are useful. If one gets the code by reading it, putting comments (to me) seems dangerous in that it adds room for mistakes: people can change the code but not the comment attached to it (I've been guilty of this), at which point the comment is no longer applicable or, even worse, false. This can result in a huge loss of time. And I'm not sure if there would have been a gain of time in my reading these comments. If I had read them, I still would have gone down into the code and figured out what various variables, functions, and loops did based on how they're used. Again, this is my failure to get which comments are useful and which aren't, so I'm not against the proposal to add more. What I need in order for my work to be efficient is for someone to go through and mark places in the code /* TOCOMMENT: - why is X doing why */ or what have you. Cheers, MS |
[Prev in Thread] | Current Thread | [Next in Thread] |