C Indentation Survey Results (long...)

Geoff Collyer geoff at utcs.UUCP
Sun Apr 28 10:42:07 AEST 1985


For those of us who like ``the One True Brace Style'' (i.e. the style
used in the v7 kernel and K&R), the System V cb is a big improvement over
the v7 cb.  The v7 one was pretty wimpy, but the System V one when invoked
as `cb -s -j' does a pretty good job of making even fairly wretched code
legible.  It's not as good as Mike Tilson's para pretty-printer for v6 C,
alas.  Para could be fed a C program containing no unnecessary whitespace
and produce a fairly beautifully formatted equivalent.  Para had the guts
to assume that the original formatting was utterly wrong and completely
reformatted the program.

As an aside, one of the first programs one would want to sic `cb -s -j'
on is cb.c.  Why is it that the sources of so many pretty-printers
(notably v7 cb, Sys V cb and I believe indent) are themselves in need of
pretty-printing?  I'd have more confidence in a pretty-printer if its source
were attractive, just as one is suspicious of a chef who won't eat his own
cooking.

Incidentally, the first things I usually do with incoming code are to beautify
it, delint it and *then* visually inspect and debug it.  I wish that these
precautions were not routinely necessary; in particular I feel that I shouldn't
have to delint code that originated on UNIX(tm).
-- 
Eighth Edition: consider it UNIX.



More information about the Comp.lang.c mailing list