comma operator: keep away?

Henry Spencer henry at utzoo.uucp
Thu Apr 27 07:46:22 AEST 1989


In article <28890 at ucbvax.BERKELEY.EDU> jas at ernie.Berkeley.EDU.UUCP (Jim Shankland) writes:
>Sigh.  Must have been lousy weather in Toronto that morning.

No, actually, the Toronto weather's been fine.

>We're agreed that a professional programmer should code as clearly
>and readably as possible, and that gratuitous cleverness is a bad
>thing.  My original posting said so.  What I consider self-evidently
>true, and you consider self-evidently false, is that the comma
>construct is sometimes at least as clear as the equivalent compound
>statement...

As my original posting said, it is a well-established fact, backed by
various experiments on things like reading rates, that familiar styles
are easier to read.  This particular comma construct is uncommon and
hence likely to be unfamiliar.  QED.

There are always unusual cases where the usual style is, for some special
reason, less clear than some variant.  But these are unusual cases, and
should not be taken to indicate acceptable variation in normal code.
-- 
Mars in 1980s:  USSR, 2 tries, |     Henry Spencer at U of Toronto Zoology
2 failures; USA, 0 tries.      | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.unix.questions mailing list