C Indentation Survey Results (long...)

Henry Spencer henry at utzoo.UUCP
Wed May 1 09:11:53 AEST 1985


> PS - readability is personal things, and you *will not* convince me that
> the K&R format is readable, just as I won't convince you that it isn't.

To correct (well, to make a near-hopeless gesture at correcting...) a
common misconception:  the K&R format is *not* hard to read/use.  It is
hard to *learn*.  Once you make the effort to get used to it, reading it
is no problem.  I speak from experience here; I thought it was hard to read
too, until I was forced to read it for a substantial length of time.  Then
it was easy.

I am not arguing that difficulty of learning isn't a defect, by the way.
Just pointing out that the K&R format is being maligned for the wrong
thing.  I won't go so far as to say "try it, you'll like it"... but I
will say "if you try it seriously, you'll find it gets a lot easier".

So as to end this on a realistic note...  One other vice of the K&R
style is that its readability degrades seriously in the presence of
violations of the style rules.  Any style is more readable when it is
followed consistently, of course, but K&R's readability drops especially
badly when the author is even a bit sloppy.  There are rather too many
examples of this in Unix code...
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list