Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!tymix!cirrusl!sunfire!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: TRUE and FALSE Message-ID: <2341@cirrusl.UUCP> Date: 31 Aug 90 01:47:12 GMT References: <11215@alice.UUCP> <514@demott.COM> <2316@cirrusl.UUCP> <1990Aug29.153917.28110@warwick.ac.uk> Sender: news@cirrusl.UUCP Lines: 37 I was brash enough to suggest #define ZERO 0 #define ONE 1 and Sean Legassick chastises me thus: This has to be one of the most useless suggestions I have read on this newsgroup. But in fact my suggested definitions are much more useful than the common recommendation of defining TRUE and FALSE. No matter how careful the original programmer is, sooner or later somebody will come along and, noticing that TRUE means true, will try to do something like: i = isdigit(c); ... if (i == TRUE) ... thereby introducing a bug. If, on the other hand, TRUE were not defined but ONE were available, the coder would probably do: i = isdigit(c); ... if (i == ONE) ... which would immediately make him ask himself: "The return value from isascii() is true, but is it really 1?" Of course, defining ONE and ZERO is fairly silly. But defining TRUE and FALSE is quite risky. I'll take fairly silly over quite risky any day. -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi