Xref: utzoo comp.unix.questions:13046 comp.lang.c:17856 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ernie.Berkeley.EDU!jas From: jas@ernie.Berkeley.EDU (Jim Shankland) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: comma operator: keep away? Message-ID: <28890@ucbvax.BERKELEY.EDU> Date: 24 Apr 89 23:32:48 GMT References: <10007@smoke.BRL.MIL> <498@lakart.UUCP> <10057@smoke.BRL.MIL> <628@gonzo.UUCP> <28831@ucbvax.BERKELEY.EDU> <1989Apr24.172219.817@utzoo.uucp> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: jas@ernie.Berkeley.EDU.UUCP (Jim Shankland) Organization: University of California, Berkeley Lines: 30 In article <1989Apr24.172219.817@utzoo.uucp> henry@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@ernie.berkeley.edu "Blame it on the lies that killed us, blame it on the truth that ran us down"