home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16389 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.5 KB  |  60 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mcsun!hp4at!sca
  3. From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Message-ID: <1992Nov12.140710@gese.ge14.mdadv.gv.at>
  6. Originator: sca@gese0n.ge14.mdadv.gv.at
  7. Sender: usenet@hp4at.eunet.co.at (USENET - Admin account)
  8. Nntp-Posting-Host: gese.ge14.mdadv.gv.at
  9. Organization: MD-ADV
  10. References: <140742@lll-winken.LLNL.GOV> <2184@ontek.com> <1992Nov12.101654.21932@thunder.mcrcim.mcgill.edu>
  11. Date: Thu, 12 Nov 1992 13:07:10 GMT
  12. Lines: 46
  13.  
  14.  
  15.  
  16.  
  17.      if   (condition)
  18.           nice statement;
  19.      else {
  20.           lot's of statements ...
  21.           }
  22.  
  23.      if   (cond)
  24.           do_this;
  25.      else if   (cond)
  26.                do_that;
  27.           else got_lost;
  28.  
  29.      for  (and so on ...)
  30.           {
  31.           body ...
  32.           }
  33.  
  34.      while(cond)
  35.           {
  36.           and so on ...
  37.           }
  38.     
  39. Got the main idea ?
  40. Not only the "if's" but all blocks take the same
  41. indention: 5 spaces.
  42. To avoid another discussion: I like to have the 
  43. paranthesis under each other VERY much, especially
  44. the opening and closin one's. Who the hack has invented
  45. this unlucky 
  46.      if  (cond) {
  47.          ugly_statements;
  48.          }
  49. paranthesis-into-if-line-style ????
  50.  
  51. regards, Petzi
  52. -- 
  53. ----------------------------------------------------
  54. Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
  55. MD-ADV, Municipality of the City of Vienna, Austria
  56. -- 
  57. ----------------------------------------------------
  58. Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
  59. MD-ADV, Municipality of the City of Vienna, Austria
  60.