Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!cs.umn.edu!talon.UCS.ORST.EDU!usenet!ogicse!intelhf!ichips!inews!hopi!bhoughto From: bhoughto@hopi.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: One more point regarding = and == (more flamage) Message-ID: <3477@inews.intel.com> Date: 27 Mar 91 03:54:46 GMT Article-I.D.: inews.3477 References: <925@isgtec.UUCP> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 33 In article <925@isgtec.UUCP> robert@isgtec.UUCP writes: >In article <355@smds.UUCP>, rh@smds.UUCP (Richard Harter) writes: >|> Re: >|> a) while (*foo++ = *bar++) >|> b) while (*foo ++ == *bar++) >|> c) while ((*foo++ = *bar++) != 0) >|> >|> Sundry claims have been made that (c) is "good style" versus (a). The >|> original objection was couched in terms of "testing on assignment inside >|> conditionals is bad form". IMNSHO most of the arguments and dogmatic >|> statements are so much rubbish. >Well the biggest argument has been if you use a) the maintainer can't tell >if you meant a) or b); if you use c) the maintainer KNOWS you meant a). >This isn't rubbish. I was considering this just this morning, and came to the conclusion that (1) any maintainer that dumb still has no clue about b); and, (2) a lot of repetitive stylistics become mechanized, and it's easy to type that != 0 when you don't really mean it, at 4:30am, when you're down to chewing the styrofoam cup from your last cup of coffee... So in the first case it's only half a fix (properly glued-down comments are whole and beautiful), and in the second it's seven extra characters waiting for lint2000(1) to grok their precisely _intended_ place in the universe. I have new lollipops screen-printed with calligraphic images of c) for those humans who are also waiting for such a lint... --Blair "Ahh, 4:30am. It's traditionally when most fortuitous errors occur..."