home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ontek!mikey
- From: mikey@ontek.com (euphausia superba)
- Newsgroups: comp.lang.c
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <2184@ontek.com>
- Date: 9 Nov 92 19:13:08 GMT
- References: <140742@lll-winken.LLNL.GOV>
- Followup-To: alt.dev.null
- Organization: Ontek Corporation -- Laguna Hills, California
- Lines: 44
-
- I was hoping that I could sit idly by while someone else posted my
- opinion about code formatting so that I could appear aloof to this
- tired old subject. Alas, no one (at least not this time around)
- has brought up this viewpoint:
-
- Establishing a consistent, company-wide style of code formatting
- results in a loss of information. When several programmers
- collaborate on a project, even a source code control system has
- difficulty identifying exactly who wrote what statement. Each
- programmer should be free to establish his own style, to serve as a
- signature so that in case of a question about the code later, there
- is at least some *hint* as to who exactly screwed up, without having
- to check out old revisions and compare the modifications (if they
- are even available.)
-
- So that nobody is tempted to follow this up with the flaws
- in my reasoning, I'll mention them here:
-
- 1. There are only so many cohesive "styles" available to
- choose from. After hiring, say, 20 programmers, it's
- almost a certainty that a several will have styles so
- close as to be indistinguishable.
-
- 2. Programmers can "disown" code they're ashamed of by rewriting
- it in someone else's style.
-
- 3. Some anal-retents, when given a hunk of code to maintain
- or enhance, will reformat it before beginning work on
- on it anyway, erasing the style-signatures of the previous
- authors and wasting time in the process.
-
- 4. The main thesis of advocates of enforced coding styles: that
- these differing styles lead to unreadable code.
-
- But a little "Hey, Bob, did you write this? Can you tell me if..."
- from time to time is a surprisingly effective productivity tool and
- should not be discarded in the name of readability.
-
- This is a subject that's been posted to death several times over the
- years, and there's about a 50-50 chance I'll end up cancelling this
- message anyway. Followups to alt.dev.null.
-
- the krill
-
-