home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16712 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.9 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!olivea!charnel!psgrain!ee.und.ac.za!shrike.und.ac.za!hippo!iwr1.ru.ac.za!andrew
  2. From: andrew@iwr.ru.ac.za (Andrew Murdoch)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Message-ID: <andrew.7.722077000@iwr.ru.ac.za>
  6. Date: 18 Nov 92 08:56:40 GMT
  7. References: <140742@lll-winken.LLNL.GOV> <9130056@hpavla.lf.hp.com> <605@ulogic.UUCP>
  8. Sender: news@hippo.ru.ac.za
  9. Organization: Rhodes University, Grahamstown, South Africa
  10. Lines: 27
  11.  
  12. In article <605@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
  13. >From: hartman@ulogic.UUCP (Richard M. Hartman)
  14. >Subject: Re: The Correct Way To Write C if-Statements
  15. >Date: 14 Nov 92 23:48:17 GMT
  16. >In article <9130056@hpavla.lf.hp.com> gajdos@hpavla.lf.hp.com (Larry Gajdos) writes:
  17. >>In comp.lang.c, booloo@framsparc.ocf.llnl.gov (Mark Boolootian) writes:
  18. >>
  19. >>> Braces
  20. >>
  21. >>> Braces belong on children's teeth and around the body of every 
  22. >>> single if-statement.  There are no exceptions.  Every single if-body 
  23. >>> is to be surrounded by braces.  The essence of the argument in favor 
  24. >>> of braces is this: all if-statements should look the same, 
  25.     ...  stuff deleted
  26.  
  27. >>Just for the sake of argument (-; doesn't this logic then imply that,
  28. >>since some if statements have else clauses, all if statements should have
  29. >>else clauses?
  30. >
  31. >No, but it might imply that all tests should be constructed to 
  32. >insist on TRUE conditions and not allow the negation of the test e.g.:
  33.     ... stuff deleted
  34. This seems totally illogical to me.  Ho far do you want to extend this 
  35. concept?  One might then say that since if statements are just C statements,
  36. all C statements should look the same, and then not use certain features 
  37. offered by the language.  Some if statements have 'else's and some don't, 
  38. and some if statements have braces, and some don't.
  39.