Comments (45)

36 Name: #!/usr/bin/anon 2006-02-12 10:46 ID:haVlcBYk

>Kids these days, they need to trick themselves into discipline.

Can't argue with that. I do need to trick myself, and writing the outline of my method first is the least boring way I found. I dislike writing comments just as I finish to code, and too often I find myself writing them at the end of the day, or every other day, in bulk. It may be a failure of my character, but hey, at least I try to compensate for it this way.

>I believe writing comments using as I understand PPP would prevent you from changing your mind and improving the implementation while you write it.

I'm just lousy at explaining, then. Comments are never good if they are at the level of implementation, and PPP comments are no exception : they should document the intent behind a portion of code.

As for improving the design as you go, I like to do most of my thinking beforehand, so it rarely happens to me. When it does happen, well, I update the comments as I go. I don't think anyone would go "ah, but I can't change this otherwise my comments won't be appropriate anymore !" when it's so quick to change a line of comment. And since you only write the outline of your code, most improvements won't affect your comments since they will be too low-level.

>There are a lot of things you need to get clear in your head, and maybe on your draft, but that you really should express by using a self-explanatory idiom instead of a comment.

You can use self-documenting code AND a small comment every ten lines or so to help scan through code more easily. Again, I'm not talking about commenting every line of code (that would make it unreadable), and I'm assuming you do want to comment - there are pros and cons, some may argue writing self-explanatory code makes comments redundant.

This thread has been closed. You cannot post in this thread any longer.