Class comments!?

Bernhard Pieber bernhard at pieber.com
Mon Oct 18 21:35:47 UTC 2004


"Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:
> Bernhard Pieber <bernhard at pieber.com> wrote:
> 	- Comments are a form of redundancy.
> 
> It seems to me that this is the heart of his argument.
> 
> I deny it.  What I always tell me students is
> 
>     "Comments should tell the reader what s/he needs to know
>      that ISN'T there in the code."
> 
> The topic of this thread is class comments, and they are by no means
> redundant.  When written by someone with even half a brain, they tell
> me things I need to know that are NOT obvious from the code.
> And that's why we need them.

Mr. O'Keefe,

Thanks for reading my posting and taking the time to reply!

Point taken. I wrote "Comments are a form of redundancy." You are right
that this statement is false. Let me take it back. While I have
definitely seen a lot of comments which are completely redundant, this
is of course not true for all comments. A lot of them are really
helpful.

I can and do completely agree with your statement. I would be interested
in your position about the negation: "Comments should NOT duplicate
things which are in the code."

However, I must disagree with one thing: I do not consider the above -
false - statement the heart of my argument. I consider this to be the
economic argument: Given a finite amount of time, what is it best spent
on to increase the understanding for the reader: Writing additional
tests, refactor the code or write comments? I would be very interested
in your thoughts about this.

Kind regards,
Bernhard Pieber




More information about the Squeak-dev mailing list