home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!wupost!usc!sol.ctr.columbia.edu!destroyer!ncar!csn!raven!rcd
- From: rcd@raven.eklektix.com (Dick Dunn)
- Subject: Re: C code Layout
- Message-ID: <1992Dec15.073140@eklektix.com>
- Organization: eklektix - Boulder, Colorado
- References: <1992Dec14.074411@eklektix.com> <1992Dec14.175533.8400@fcom.cc.utah.edu>
- Date: Tue, 15 Dec 1992 07:31:40 GMT
- Lines: 43
-
- bryant@ced.utah.edu writes:
- [good stuff deleted]
- >one assignment was to comment the command "strings", which (from the
- >distribution) had (if I remember right) ONE COMMENT LINE. I don't know
- >who that style works for. Certainly not anyone in the class or the
- >instructors.
-
- As noted elsewhere, that's Berkeley and not B'Labs. OK, I'd find it hard
- to believe that strings could get away with one comment. On the other
- hand, I wouldn't think it would need a lot. Maybe we should drag this out
- as an example and look it over? (It's probably under the UCB copyright,
- which is OK. I'm just thinking that one real example might get us some-
- where.)
-
- >i++ vs. i = i + 1? What was that about Gothic cathedrals??
-
- You've lost me. i++ is a C idiom; i = i + 1 looks wrong in a C program.
- How could an uncommon 5-token sequence be better than a common 2-token
- sequence?
-
- >>Next, you've got seven lines for a very simple task:...
- ...
- >Again, too wordy for one is not enough for another. The blank lines
- >and "gratuitous ornaments" are very much a matter of personal style
- >and if used consistantly are fine for me.
-
- Hold on. We've got something almost objective (sorry) that's being lost
- here. If you have a display window for editing/viewing a file, it's of a
- certain rather limited size. (Even if it were "arbitrarily large", you can
- still only effectively see so much.) There's a cognitive discontinuity:
- what you can take in at one glance is far more understandable than what you
- have to shuttle back and forth to see.
-
- This is why the difference between one line and seven is far more than "a
- matter of personal style", because it may be the difference between being
- able to see a unit and having to break it. It strikes close to what
- "overcommenting" means in a practical sense. 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. It's tied up in many
- factors, including the way our natural language is written, but it's real.
- --
- Dick Dunn rcd@eklektix.com -or- raven!rcd Boulder, Colorado USA
- ...Mr. Natural says, "Use the right tool for the job."
-