Xref: utzoo comp.unix.questions:13036 comp.lang.c:17830 Newsgroups: comp.unix.questions,comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: comma operator: keep away? Message-ID: <1989Apr24.172219.817@utzoo.uucp> Organization: U of Toronto Zoology References: <10007@smoke.BRL.MIL> <498@lakart.UUCP> <10057@smoke.BRL.MIL> <628@gonzo.UUCP> <28831@ucbvax.BERKELEY.EDU> Date: Mon, 24 Apr 89 17:22:19 GMT In article <28831@ucbvax.BERKELEY.EDU> jas@ernie.Berkeley.EDU (Jim Shankland) writes: >I still suggest that a C programmer who understands: > >(A) if (x->in_use) > { > x++; > y++; > } > >but who is mystified by: > >(B) if (x->in_use) > x++, y++; > >had best be investigating alternate career paths. This is very true. On the other hand, a C programmer who writes the latter should also 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 (A) and not (B). A programmer with a professional attitude will therefore use (A) to make his code as readable as possible, unless there is some special reason to do otherwise. To quote #8 from the Ten Commandments for C Programmers: Thou shalt make thy program's purpose and structure clear to thy fellow man by using [a familiar style], even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding. -- Mars in 1980s: USSR, 2 tries, | Henry Spencer at U of Toronto Zoology 2 failures; USA, 0 tries. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu