home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19563 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.3 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!newsserver.jvnc.net!yale.edu!yale!gumby!destroyer!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: HELP : C programming Guideline
  5. Message-ID: <1993Jan12.024932.27939@organpipe.uug.arizona.edu>
  6. Date: 12 Jan 93 02:49:32 GMT
  7. References: <C0pBDG.7Ky@news2.cis.umn.edu>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 40
  12. In-Reply-To: smahn@vx.cis.umn.edu (Seokmin Ahn)
  13.  
  14. In article <C0pBDG.7Ky@news2.cis.umn.edu>, smahn@vx (Seokmin Ahn) writes:
  15. >I am looking for a C  (not C++) programming guideline.
  16.  
  17. Hmm... let's see... how about these:
  18.  
  19.   0. Understand the problem you're trying to solve.  The better
  20.      you understand it, the better you can solve it.
  21.  
  22.   1. Know the language.  The strengths and the weaknesses.
  23.      Think about how to use the strengths in your application
  24.      while avoiding the weaknesses.
  25.  
  26.   2. Portability is an issue that should be considered early
  27.      on.  The range of target machines (and OS's) can greatly
  28.      effect fundamental design decisions.
  29.  
  30.   3. Don't abuse the preprocessor.
  31.  
  32.   4. Adopt a coding style (indentation, brace placement, naming
  33.      conventions, etc) and stick to it.  It's probably best to
  34.      write out the conventions (if they're not already given to
  35.      you).  It's probably also a good idea to make a list of ways
  36.      you think the style could be improved...
  37.  
  38.   5. Look at other peoples' code.  It will give you a perspective
  39.      you can't find working on your own, and it will also give you
  40.      a better idea of what's good and what's bad.
  41.  
  42.   6. Know what constructs cause undefined behavior and avoid them.
  43.      As a corollary, avoid overly-complex constructs.
  44.  
  45. There's also some pointers to style guides available via ftp in the FAQ
  46. (which should still be available at your site -- just search backward
  47. for a post with "Frequently" in the title, and you should find it)
  48.  
  49. -- 
  50. You unlock this door with the key of imagination.  Beyond it is another
  51. dimension: a dimension of sound, a dimension of sight, a dimension of mind.
  52. You're moving into a land of both shadow and substance, of things and ideas.
  53. You've just crossed over into... the Twilight Zone.
  54.