home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!portal!dfuller
- From: dfuller@portal.hq.videocart.com (Dave Fuller)
- Subject: Re: Hows this for odd
- Message-ID: <BxGq4z.8oA@portal.hq.videocart.com>
- Organization: VideOcart Inc.
- X-Newsreader: Tin 1.1 PL3
- References: <1992Nov9.102217.23060@monu6.cc.monash.edu.au>
- Date: Mon, 9 Nov 1992 19:00:34 GMT
- Lines: 24
-
- bena@yoyo.cc.monash.edu.au (Ben Aveling) writes:
- :
- : Hi all,
- :
- : Just recently I saw the following fragment of code, and I thought I'd share
- : it with you all. (This is real code, part of a real program people will
- : pay money for.)
- :
- : ... ,(i==0)?TRUE:FALSE,...
- :
- : Am I going mad, or is this slightly redundant ?
- :
- : :-/ Ben
-
- Not at all. Depends on what TRUE & FALSE are, and what they mean to the
- calling function. possible that TRUE is defined as -1, FALSE as -2.
- 0 does not always mean TRUE. actually i prefer to always give a TRUE and FALSE
- definition and return them from all functions. this way code is more
- readable and checking return values (func() == 0) vs (func() == TRUE)
- is much easier this way.
-
- Dave Fuller
- dfuller@portal.hq.videocart.com
-
-