Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: C Style (Was Re: == vs =) Message-ID: <10535@steinmetz.ge.com> Date: 22 Apr 88 15:20:02 GMT References: <11216@brl-adm.ARPA> <2111@chinet.UUCP> <4403@garfield.UUCP> <226@hotlr.ATT> <130@obie.UUCP> <5981@utcsri.UUCP> <1982@ubc-cs.UUCP> <126@atpal.UUCP> <2823@mmintl.UUCP> <255@oink.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 20 In article <255@oink.UUCP> jep@oink.UUCP (James E. Prior) writes: | Amen!, and I'll go one further | | if (var==TRUE) | | is not only abominable, it can be dangerous. var==TRUE tends to presume | that the only valid values of var are FALSE and TRUE. There are times | when a var can very intentionally have a non-zero (true) value other than | TRUE (1). The classic kind of case of this is var=isalpha(c). The If you *must* use stuff like this, at least you can write: if (var != FALSE) which is more likely to work. There is only one good reason I can determine to use code like that: some COBOL programmer wrote the style specs for your organization. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me