home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!europa.asd.contel.com!emory!nastar!phardie
- From: phardie@nastar.uucp (Pete Hardie)
- Subject: Re: C code Layout
- Message-ID: <1992Dec17.161512.9019@nastar.uucp>
- Organization: Digital Transmission Systems, Duluth, GA.
- References: <1992Dec15.073140@eklektix.com> <1992Dec15.153859.29057@nastar.uucp> <1992Dec17.074616@eklektix.com>
- Date: Thu, 17 Dec 1992 16:15:12 GMT
- Lines: 42
-
- In article <1992Dec17.074616@eklektix.com> rcd@raven.eklektix.com (Dick Dunn) writes:
- >I wish we had a way to get some useful objective data on this. My hand-
- >wave against the argument Pete presents is that the K&R style has one line
- >at either end of the bracketed range, rather than two at the start and one
- >at the end.
-
- I handwave back that this marks conditionals (while, do, etc) better, to
- call their importance out.
-
- (all this waving going on....creating quite a draft...)
-
- >at the end. Anyway, humans don't pay much attention to the brackets! We
- >use indentation. Don't believe it? Just try people on something like:
- > if (i <= 0)
- > mumble = 0;
- > return;
-
- I agree that the visual nesting outperforms the textual, but neither brace
- style seems to definitively correct this, since it's really an error in the
- placement of any text.
-
- >In general, if indentation fails to match the real nesting, people will
- >"see" the nesting (wrongly) implied by indentation. Also, if you give { a
- >line by itself, you get the rather stringy
- > }
- > else
- > {
- >instead of
- > } else {
-
- To me, this 'hides' the else, making it less visible. It also makes it
- (slightly) harder to do a pattern search for ALL elses. I can use /^else
- with my indentation, while I need an optional pattern to find them with
- your style.
-
-
-
- --
- 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 |
-