home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16698 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.1 KB  |  33 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!concert!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!sci.kun.nl!cs.kun.nl!hansm
  3. From: hansm@cs.kun.nl (Hans Mulder)
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Message-ID: <BxvIyA.Co2@sci.kun.nl>
  6. Sender: news@sci.kun.nl (NUnet News Owner)
  7. Organization: University of Nijmegen, The Netherlands
  8. References: <1992Nov12.101654.21932@thunder.mcrcim.mcgill.edu> <1992Nov12.140710@gese.ge14.mdadv.gv.at> <3860@dozo.and.nl> <1992Nov16.175117.29633@dg-rtp.dg.com>
  9. Date: Tue, 17 Nov 1992 18:49:21 GMT
  10. Lines: 21
  11.  
  12. In <1992Nov16.175117.29633@dg-rtp.dg.com> goudreau@robin.rtp.dg.com (Bob Goudreau) writes:
  13.  
  14. >Actually, this isn't quite right.  The K&R style is to align the
  15. >terminating brace with the first letter of the "if" (or "while",
  16. >etc.):
  17.  
  18. >    if (cond) {
  19. >        ugly_statements;
  20. >    }
  21.  
  22.  
  23. But if you format your statements that way, they're no longer ugly, ergo:
  24.  
  25.     if (cond) {
  26.         beautified_statements;
  27.     }
  28.  
  29. :-)
  30.  
  31. --
  32. Hans Mulder                hansm@cs.kun.nl
  33.