home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / software / 5040 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  1.3 KB

  1. Path: sparky!uunet!dtix!mimsy!casemo!keating
  2. From: keating@casemo.UUCP (John Keating )
  3. Newsgroups: comp.software-eng
  4. Subject: Re: C code Layout
  5. Message-ID: <454@casemo.UUCP>
  6. Date: 17 Dec 92 18:22:22 GMT
  7. References: <1992Dec14.074411@eklektix.com> <1992Dec15.153859.29057@nastar.uucp>
  8. Organization: Cray Communications, Inc.
  9. Lines: 39
  10.  
  11. In article <1992Dec15.153859.29057@nastar.uucp>, phardie@nastar.uucp (Pete Hardie) writes:
  12.  
  13. > A brief comment (NPI :->) here.  I find that the brace style:
  14. >     if(condition)
  15. >     {
  16. >         statement;
  17. >         ...
  18. >     }
  19.  
  20. > is more readable than this style:
  21. >     if(condition) {
  22. >         statement;
  23. >         ...
  24. >     }
  25.  
  26. > However, for some reason, I detest the indention of the braces, like this:
  27. >     if(condition)
  28. >         {
  29. >         statement;
  30. >         ...
  31. >         }
  32.  
  33. I prefer the following:
  34.         if (condition)
  35.           {
  36.             statement ;
  37.             ...
  38.           }
  39.  
  40. This sets both the condition statement and the action statements apart, plus
  41. keeps the braces aligned.
  42.  
  43. I have no love at all for the second method above (K&R?)
  44.  
  45. John W. Keating, III
  46. -- 
  47.       John William Keating, III      /-----------------------------------------
  48.  -+=< Cray Communications, Inc. >=+- | If you do something stupid after reading
  49.  formerly: Dowty Communications Inc. | this message, it is your own fault, not
  50.    keating%casemo@mimsy.cs.umd.edu   | mine nor the company I work for.  -me-
  51.