home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!srhqla!quest!kdq
- From: kdq@quest.UUCP (Kevin D. Quitt)
- Newsgroups: comp.lang.c
- Subject: Re: How to use 'return' in c?
- Message-ID: <gm5XTB3w165w@quest.UUCP>
- Date: Sun, 08 Nov 92 16:31:03 PST
- References: <1992Nov7.122126.24409@druid.uucp>
- Reply-To: srhqla!quest!kdq
- Organization: Job quest (805) 251-8210, So Cal: (800) 400-8210
- Lines: 21
-
- darcy@druid.uucp (D'Arcy J.M. Cain) writes:
-
- > allebrandi@ipact.com writes:
- > >The best thing to do is to use manifest constants to implicitly document
- > >the value you are returning. For example, return TRUE or FALSE not 1 or
- > >0 for a boolean function return.
- >
- > Whenever I see TRUE and FALSE in code I am maintaining I remove the
- > #defines. If they are defined, they should never be anything but
- > TRUE = 1 and FALSE = 0. Anything else is confusing and misleading.
-
- On the other hand, since C does not truly support the boolean type,
- I consider it misleading to assign a numeric value to a boolean. I
- define TRUE as (1==1) because the result of this is a boolean - the
- fact that it is represented by a numerical value is misleading.
-
- _
- Kevin D. Quitt Job Quest (805) 251-8210
- srhqla!quest!kdq Learn How to Get a Job in SoCal
-
- 96.37% of all statistics are made up.
-