Ten Commandments for C Programmers (Summarized)


  1. Run lint frequently, fix warnings
  2. Don't follow the NULL pointer
  3. Cast all functions to their expected type
  4. If the headers don't declare the return types of a function, declare them yourself
  5. Check array bounds on all arrays, especially strings
  6. If a function can return error codes, check for them
  7. Don't reimplement library functions
  8. Use the One True Brace Style (i.e. K+R)
  9. Identifiers should be unique in the first six characters
  10. All the world is not a VAX (or a Sun, or a 386, or 32 bits, or...)

Specifically amusing quotes

original, with annotation.


source: Henry Spencer
keywords: keywords
date: 03/18/2005