home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16188 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.3 KB

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