comments (proposal)

Kirk Petersen (kirk@eidolon.speakeasy.org)
Tue, 6 Jan 1998 22:49:43 -0800


On Tue, Jan 06, 1998 at 04:51:02PM -0600, Michael Elizabeth Chastain wrote:
>
> I often find, when I am writing documentation, that it motivates
> me to make my code cleaner and clearer. I would rather clean
> something up than write an excuse for it in my documentation.

I agree completely. Although most commenting seems to be along the lines
of "this does something bad, fix later", I think there is real potential.
Just look at some book like Linux Kernel Internals or some W. Richard
Stevens books. In places, they are just sections of code with well
written comments interlaced (which is what the situation calls for, I
believe).
So, I was thinking that the Linux kernel would benefit from having these
kinds of comments. Perhaps not every function and data structure, but
certainly the system calls and the majority of the functions and structures
that are used directly in the system calls.
It would certainly help us beginners (frankly, it isn't very
helpful to tell a beginner to "use the source, luke" when it is as complex
as the Linux kernel and not well commented). So, as I read through the
source, learn things, and make notes, I'll be trying to write detailed
comments that describe what the code does.
What are your thoughts? Would detailed comments be too
distracting? Would they be impossible to maintain? What
are the odds of the comments being inserted into the kernel?

-- 
Bye,
Kirk Petersen
http://www.muppetlabs.com/~kirk/