comma operator: keep away?

Jim Shankland jas at ernie.Berkeley.EDU
Tue Apr 25 09:32:48 AEST 1989


In article <1989Apr24.172219.817 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>On the other hand, a C programmer who [uses a comma operator to sequence
>two closely related expression evaluations, instead of two statements]
>should ... be investigating alternate career paths, because he's clearly
>an amateur in a business that needs professionals.  Anyone who says "any
>competent programmer ought to be able to understand that!" rather than
>"I should make my code as clear as possible!" is an amateur, and one with
>an ego problem at that.  Readability is very much a matter of what you're
>used to.  Like it or lump it, most C programmers are used to [the compound
>statement] and not [the comma construct].

Sigh.  Must have been lousy weather in Toronto that morning.

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.  Short of running code comprehension experiments on
hundreds of bad C programmers, I don't see how we can resolve our
difference of opinion.  But at least I haven't questioned your
professionalism.

Now look what you've done.  Made me grumpy.  Not, on the whole, an
easy thing to do.

Jim Shankland
jas at ernie.berkeley.edu

"Blame it on the lies that killed us, blame it on the truth that ran us down"



More information about the Comp.unix.questions mailing list