home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!csn!raven!rcd
- From: rcd@raven.eklektix.com (Dick Dunn)
- Subject: Re: C code Layout
- Message-ID: <1992Dec16.083733@eklektix.com>
- Organization: eklektix - Boulder, Colorado
- References: <1992Dec14.175533.8400@fcom.cc.utah.edu> <1992Dec14.235521.1557@cbnewsm.cb.att.com> <KANZE.92Dec15171105@slsvdnt.us-es.sel.de>
- Date: Wed, 16 Dec 1992 08:37:33 GMT
- Lines: 67
-
- kanze@us-es.sel.de (James Kanze) writes:
- >lfd@cbnewsm.cb.att.com (Lee Derbenwick) writes:
- >|> One reason that I personally dislike very large comments embedded in
- >|> the code is that they greatly reduce the amount of code within my
- >|> visual field (whether on a screen or on paper):...
- ...
-
- Scott McGregor talks about the same phenomenon (and some of the tradeoffs
- surrounding it) in considerably more detail. But it's a good point in any
- case.
-
- [Kanze applies name "band width theory"]
- >the number of characters [the page] can contain, and the goal is to use
- >this band width in an optimal fashion.)
-
- This, by itself, seems a straightforward statement. Since what we've been
- talking about is, after all, how to convey information beyond what the code
- itself says, isn't there some goal to use the available space in an optimal
- fashion? Not a "most compact" fashion, mind you..."optimal" refers to
- "best", not "smallest".
-
- >Of course, this means that you also put several short statements on
- >the same line, code on the same line as the opening brace, etc...
-
- No, it doesn't mean that. Where is it written that "optimal" means
- "extreme to the point of obvious stupidity"?
-
- There are cases where you might put several short statements on a line, if
- they're intimately related to one another. For example,
- t = x0; x0 = x1; x1 = t;
- This is a single operation, a simple "exchange x0, x1". But the criterion
- is not merely "short"; it is "intimately related".
-
- And even K&R style, one of the more compact C styles, does not put code on
- the same line as the opening brace.
-
- In other words, you are trying to set up a straw man, and you have been
- insufficiently subtle, so your device is found out even by dullards like
- me.
-
- >...And of course, you never, never leave a line blank.
-
- More strawman.
-
- >This also argues for short variable names. (They increase the chances
- >of getting more than one statement on a line.)
-
- Apparently you've succeeded in ignoring the real reason for short variable
- names--even though it's well known and has also been discussed here
- recently: a common practice, in natural as well as artificial language, to
- use the most compact forms for the most common words.
-
- >In case it's not obvious from the tone of my comments, I am in total
- >disagreement with this style.
-
- In case it's not obvious from the tone of my reply, I am pointing out
- that the "style" with which you totally disagree is an invention of your
- own imagination.
-
- The remainder of this discussion has mostly moved in the direction of
- noting the endpoints of common usage and exploring the ground in between.
- You do no service--unless you are simply looking for baseless argument--
- by staking out ground outside where the rest of us stand, and arguing that
- it is wrong.
- --
- Dick Dunn rcd@eklektix.com -or- raven!rcd Boulder, Colorado USA
- ...Mr. Natural says, "Use the right tool for the job."
-