Path: utzoo!utgpu!watserv1!watmath!att!occrsh!uokmax!apple!voder!pyramid!ctnews!mitisft!dold From: dold@mitisft.Convergent.COM (Clarence Dold) Newsgroups: comp.lang.c Subject: Re: Assignment in test: OK? Message-ID: <1599@mitisft.Convergent.COM> Date: 11 Sep 90 21:00:06 GMT References: <1990Sep11.003102.9271@virtech.uucp> Organization: Convergent Technologies, San Jose, CA Lines: 28 in article <1990Sep11.003102.9271@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) says: >>> if (foo = 0) > This is a BIG mistake because of any and all of the following: > 2. someone else will have to determin if you might > have made a typo > The fact that it is legal C doesn't really matter here. That kind of > coding just makes maintenance harder. I saw this in some code posted to the net awhile ago: if (foo = 0) /* Really an assignment */ Which is at least intelligible, and (possibly) rules out item 2 above. I still don't think it is good coding practice. As someone who makes a living reading other people's code, I wish more people would not try to outwit the compilers, and just buy a better compiler. -- --- Clarence A Dold - dold@tsmiti.Convergent.COM (408) 435-5293 ...pyramid!ctnews!tsmiti!dold FAX (408) 435-3105 P.O.Box 6685, San Jose, CA 95150-6685 MS#10-007