home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18842 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.4 KB  |  44 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!fburton
  3. From: fburton@nyx.cs.du.edu (Francis Burton)
  4. Subject: Re: C code Layout
  5. Message-ID: <1992Dec23.224436.8985@mnemosyne.cs.du.edu>
  6. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  7. Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
  8. Date: Wed, 23 Dec 92 22:44:36 GMT
  9. Lines: 33
  10.  
  11. Richard Hartmann writes:
  12.  
  13. >... am I in the minority here by preferring style C:
  14. >
  15. >        keyword (condition)
  16. >                {
  17. >                statement1;
  18. >                statement2;
  19. >                statement3;
  20. >                }
  21. >
  22.  
  23. Why not add in the "economy of vertical space" argument to get:
  24.  
  25.          keyword (condition) {
  26.                  statement1;
  27.                  statement2;
  28.                  statement3;
  29.                  }
  30.  
  31. Which is my indentation style.  I got the habit from "Software
  32. Tools" by Kernighan and Plauger.  Their Ratfor "language" provided
  33. me with a welcome escape from FORTRAN, before I acquired a useable
  34. C compiler.
  35.  
  36. However, I never see code using this style nowadays, and indent(1)
  37. does not support it (I think).  Why is it so unpopular when it has
  38. so much going for it? 
  39.  
  40. --
  41. Francis Burton      Physiology, Glasgow University, Glasgow G12 8QQ, Scotland.
  42. 041 339 8855 x8085  | JANET: F.L.Burton@glasgow.ac.uk  !net: via mcsun & uknet
  43. "A horse! A horse!" | INTERNET: via nsfnet-relay.ac.uk BITNET: via UKACRL
  44.