Proposal for a scientific look at C style choices

Liber nevin1 at ihlpb.ATT.COM
Wed Dec 28 10:19:59 AEST 1988


In article <272 at twwells.uucp> bill at twwells.UUCP (T. William Wells) writes:

>I consider the braces as a separate element: sometimes necessary for
>the compiler (but I always use the braces), but contributing little or
>nothing to the understandability of the program.

If the braces are necessary for the compiler (which they sometimes
are), then they do contribute to the understandability of the program.
Otherwise they wouldn't be necessary!

>The indentation of
>the program is what tells you the control relationships; the braces
>are redundant information, at best they can augment what the
>indentation is alreaddy telling you.

I feel the opposite is true (indentation provides the redundant
information, not the braces).  If the braces are wrong, my program
probably won't do what I intended it to do.  If the indentation is
wrong, my program can still compile and run correctly.  Indentation are
like comments in that there is nothing to enforce them being correct.
For maintaining other people's code, I can only rely on the same things
that the compiler relies on (in this case, the braces instead of the
indentation).
-- 
NEVIN ":-)" LIBER  AT&T Bell Laboratories  nevin1 at ihlpb.ATT.COM  (312) 979-4751



More information about the Comp.lang.c mailing list