home *** CD-ROM | disk | FTP | other *** search
- 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
- From: andrew@iwr.ru.ac.za (Andrew Murdoch)
- Newsgroups: comp.lang.c
- Subject: Re: The Correct Way To Write C if-Statements
- Message-ID: <andrew.7.722077000@iwr.ru.ac.za>
- Date: 18 Nov 92 08:56:40 GMT
- References: <140742@lll-winken.LLNL.GOV> <9130056@hpavla.lf.hp.com> <605@ulogic.UUCP>
- Sender: news@hippo.ru.ac.za
- Organization: Rhodes University, Grahamstown, South Africa
- Lines: 27
-
- In article <605@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
- >From: hartman@ulogic.UUCP (Richard M. Hartman)
- >Subject: Re: The Correct Way To Write C if-Statements
- >Date: 14 Nov 92 23:48:17 GMT
- >In article <9130056@hpavla.lf.hp.com> gajdos@hpavla.lf.hp.com (Larry Gajdos) writes:
- >>In comp.lang.c, booloo@framsparc.ocf.llnl.gov (Mark Boolootian) writes:
- >>
- >>> Braces
- >>
- >>> Braces belong on children's teeth and around the body of every
- >>> single if-statement. There are no exceptions. Every single if-body
- >>> is to be surrounded by braces. The essence of the argument in favor
- >>> of braces is this: all if-statements should look the same,
- ... stuff deleted
-
- >>Just for the sake of argument (-; doesn't this logic then imply that,
- >>since some if statements have else clauses, all if statements should have
- >>else clauses?
- >
- >No, but it might imply that all tests should be constructed to
- >insist on TRUE conditions and not allow the negation of the test e.g.:
- ... stuff deleted
- This seems totally illogical to me. Ho far do you want to extend this
- concept? One might then say that since if statements are just C statements,
- all C statements should look the same, and then not use certain features
- offered by the language. Some if statements have 'else's and some don't,
- and some if statements have braces, and some don't.
-