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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!psinntp!ptsys1!mliu
  3. From: mliu@pt.com (Fred Liu)
  4. Subject: Re: C code Layout
  5. Message-ID: <1992Dec24.142340.6500@pt.com>
  6. Organization: Performance Technologies, Incorporated
  7. References: <771@ulogic.UUCP> <1992Dec23.153137.13423@fcom.cc.utah.edu> <BzqIHE.7p3@rahul.net>
  8. Distribution: usa
  9. Date: Thu, 24 Dec 1992 14:23:40 GMT
  10. Lines: 31
  11.  
  12. In article <BzqIHE.7p3@rahul.net> kpapai@rahul.net (Ken Papai) writes:
  13. >nmp@mfltd.co.uk (Nic Percival (x5336)) writes:
  14. >
  15. >and I like style C format too:
  16. >
  17. >    if (editor == BRIEF)
  18. >         {
  19. >         printf( "You are a lucky software engineer.\n" );
  20. >         printf( "You will be rewarded handsomely because you are so 
  21. >                  productive!")
  22. >         }
  23.  
  24. I can agree with this, although I don't use this style.
  25.  
  26. >    else
  27. >         printf( "You are an unlucky VI or EMACS user. Sorry..." ); 
  28.  
  29. I don't like this.  I always rather use
  30.  
  31. >    else {
  32. >         printf( "You are an unlucky VI or EMACS user. Sorry..." ); 
  33.      }
  34.  
  35. In my C programming practice, "if ()" and "} else ()" are always
  36. followed by {.  It allows me to insert and delete printfs inside a
  37. if with least bothering to other code, and it does not take to much
  38. time and space to do that.
  39.  
  40. -- 
  41. Fred Liu, Performance Technologies Incorporated        mliu@pt.com
  42. 315 Science Parkway, Rochester, New York 14620        uupsi!ptsys1!mliu
  43.