Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: One more point regarding = and == (more flamage) Message-ID: <15563@smoke.brl.mil> Date: 25 Mar 91 08:17:47 GMT Article-I.D.: smoke.15563 References: <13603@helios.TAMU.EDU> <1991Mar22.161333.24290@dg-rtp.dg.com> <355@smds.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 20 In article <355@smds.UUCP> rh@smds.UUCP (Richard Harter) writes: >But that is a different argument, one that says one should not test on any >thing except Booleans. If it makes you happy, fine. Go for it; transform >all tests into Boolean expressions. Know, though, that in your heart you >are not a C programmer. C has very simple and explicit rules about >conditional tests. In Fortran and Pascal you test against true and false; >in C you test against 0 and non-zero. Sticking an irrelevant !=0 into the >test is no more than another of the many ways that people have of trying >to convert C into some other language. Saying that it is clearer is no >more than saying "I want to read C and see Pascal". Gee, I guess I'm not a C programmer, according to your criterion. I have found to the contrary that introduction of an explicit Boolean type, used completely and consistently, makes C source more intelligible and more likely to be correct. I would agree with an assertion that a C programmer ought to fully understand the traditional mixed numerical and Boolean usage, but I don't recommend coding in such a style.