The C programming language

From: John Wilson <wilson_at_dbit.dbit.com>
Date: Fri Mar 10 23:05:56 2000

On Fri, Mar 10, 2000 at 09:43:13PM -0500, Megan wrote:
> Unfortunately, it appears that those who advocate and write in C
> and other such structured languages appear to have lost the ability
> to comment their code (at least it seems that way from all the code
> I look at at work -- I would say a mere 5% is really commented).

I've been noticing the same thing when going source diving in the Linux
kernel and lots of other places. I think 5% would be a pretty generous
guess there (unless you count all the copyright crap and credits), most of
the time there isn't a single comment anywhere on the screen I'm looking at.

I think that a big part of the cause is indentation. C code wanders all
over the screen, while assembly code generally stays put in the left half.
So the right half of the screen is always available for comments -- the code
looks naked without them!

If you can lay your hands on unstripped sources to DEC PDP-11 OSes,
they're really nice examples of well-commented assembly language (no I'm
not kissing ass, I haven't seen the full RT sources so I wouldn't even know,
but RSX and particularly RSTS are really wonderful to read). I can usually
find the answer to my question very easily there, meanwhile with Linux I
sometimes have to dig through the sources for hours just to find the place
that interests me, and even then half the time I just have to fill it with
printfs and recompile to see what it actually does, since I can't figure
out what it's *supposed* to do.

John Wilson
D Bit
Received on Fri Mar 10 2000 - 23:05:56 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:33:05 BST