home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!emory!nastar!phardie
- From: phardie@nastar.uucp (Pete Hardie)
- Subject: Re: C code Layout
- Message-ID: <1992Dec15.153859.29057@nastar.uucp>
- Organization: Digital Transmission Systems, Duluth, GA.
- References: <1992Dec14.074411@eklektix.com> <1992Dec14.175533.8400@fcom.cc.utah.edu> <1992Dec15.073140@eklektix.com>
- Date: Tue, 15 Dec 1992 15:38:59 GMT
- Lines: 39
-
- In article <1992Dec15.073140@eklektix.com> rcd@raven.eklektix.com (Dick Dunn) writes:
- >It explains some of the
- >nuances of the "One True Brace Style" (the K&R positioning of braces),
- >which seeks to minimize wasted vertical space.
-
- A brief comment (NPI :->) here. I find that the brace style:
-
- if(condition)
- {
- statement;
- ...
- }
-
- is more readable than this style:
-
- if(condition) {
- statement;
- ...
- }
-
- for one main reason - the alignment of the open and close braces is the same,
- and this (to me) ties the block of code together. IMHO, this outweighs the
- additional single line per block of vertical space.
-
- However, for some reason, I detest the indention of the braces, like this:
- if(condition)
- {
- statement;
- ...
- }
- although I can't come up with a single rational reason.
-
-
-
- --
- Pete Hardie: phardie@nastar (voice) (404) 497-0101
- Digital Transmission Systems, Inc., Duluth GA
- Member, DTS Dart Team | cat * | egrep -v "signature virus|infection"
- Position: Goalie |
-