Proposal for a scientific look at C style choices

Griff Smith ggs at ulysses.homer.nj.att.com
Fri Jan 13 02:36:00 AEST 1989


In article <1066 at ns.UUCP>, ddb at ns.UUCP (David Dyer-Bennet) writes:
> In article <138 at mole-end.UUCP> mat at mole-end.UUCP (Mark A Terribile) writes:
> :> 
> :Do you *really* want to bury the conjuntive/disjuntive operators at the
> :end or in the middle of the line? 
> 
> Yes, definitely.  For the same reason you want to put them elsewhere:  more
> readable.  I dislike leaving a line-end that looks like a statement end
> (not being good at parsing ";" mentally), so I try to end a continued
> expression line with an operator.

I'm using this as an excuse to suggest a theory: two kinds of people
are arguing, and they have different perceptual strengths.  Mark
Terribile and I seem to be in the `visual' camp.  I `understand'
patterns, but grammar doesn't make much sense to me.  A program is not
`readable' to me; it is a two-dimensional array of meta-symbols that I
organize visually.  The example that I deleted makes best sense to me
when displayed as

if (   mumble
    && mumble
    && mumble
    && mumble )
{
	mumble;
	mumble;
}

I can then extract the if (
			   &&
			   &&
			   &&
		       {

as a single icon and know what it does, at that level of abstraction.
David Dyer-Bennet seems to be a member of the `parsing' school.  These
people like to `read' code instead of `seeing' it.  I won't explain
their perceptions, because I can't empathise with them.  They make life
miserable for me, however.  When they format similar code, it's
something like

if (whatever && something_else &&
	something_on_the_next_line &&
	something_short && something_longer &&
	the_end_of_the_list) {
	mumble;
}

This style maximizes my confusion by forcing me to `find' all the
component markers instead of `seeing' them.  I have lost most of the
visual cues, and I have to go wading through the code with my defective
parser.  I suspect the `parsers' are equally disturbed by having to
discard my superfluous white-space.

I don't have any solutions.  I do wish the two sides would be more
sympathetic to each other's problems.
-- 
Griff Smith	AT&T (Bell Laboratories), Murray Hill
Phone:		1-201-582-7736
UUCP:		{most AT&T sites}!ulysses!ggs
Internet:	ggs at ulysses.att.com



More information about the Comp.lang.c mailing list