[net.lang.c] brace wars

henry (10/29/82)

Good Ghod.  Here I go and not read netnews for a week, and there's this
appalling deluge of people saying why they love/hate assorted brace
styles...  Well, my own history is a bit more complicated.  Once upon
a time, I had my own preference in brace styles.  I thought it was a
lot better than the one KLT/DMR generally used.  I even had some arguments
to back this up.

Then I put V7 up here, and had to do a *lot* of digging around in and
modifying KLT/DMR code.  This influenced my opinions considerably.
I now use that style to the exclusion of any other, except when I am
modifying something written in another style.

Aha, cry the advocates of other brace styles!  He overdosed on that
icky brace style and burned out his cerebral lobes!  Not so.  I simply
came to a fairly obvious conclusion:  one brace style is better than
two.  And if you are working with existing Unix code, you are *stuck*
with the KLT/DMR style.  The only thing worse than a bad paragraphing
style is mixed paragraphing styles.  Consistency is much more important
than ultimate maximum beauty.

Which is why I put a considerable effort into a C style standard that
uses that style, even though I tend to agree it's not optimal.  It's
what we've got, folks, and it will not go away.

						Henry Spencer
						U of Toronto

goutal (11/02/82)

But wait!  If you had a practical pretty printer that could prettyprint
according to whatever style you wanted at a given moment,
you could get the code in the original style, edit it in the style which
helped you understand what the authors (and you) were doing, and then
put it back into the icky style.
  Yah, that's a big IF.  So were space shuttles in the forties.
  In another vein:  I tend to agree with you (Henry) that one style is
better than two, and in the absence of a prettyprinter as described
above and in the presence of code in an icky style needing modification,
I, too, would just use the style of the original authors.
(Although in the presence of terrible, awful, mean, nasty, yucky style
in a piece of code that didn't work, I have been known to reformat it
so I could figure out what was going on!)
  However, not all C code is Unix.  Not any more.  What with all these
microes and PC's and what have you, with C compilers popping up like
dandelions, a whole new generation is growing up never hearing but the
faintest rumour of a thing called a Unix, and a whole new crop of code
is getting generated by folks who don't necessarily consider Kernighan
to be on the same level as God.  (Oops!  Sorry!  Waxed motormouth there.)
That's not to belittle B.K., or even D.R., just to indicate that your
argument can go both ways.
  Pardonnez-moi ma flammage.
-- Kenn (decvax!)goutal