Coding Rules

From dis-Emi-A

Jump to: navigation, search

Contents

Major Rules

  1. No duplication
    1. Multiple inheritance helps (C++, Ruby Mixins [1])
  2. If is evil

Corollaries

  1. Exceptions are evil, but return codes are worse

Minor Rules

  1. Use Code Tagging
  2. Previous functionality trumpts new functionality
  3. third party libraries should be isolated
  4. Compile with *ALL* warnings turned on
  5. Do not rely on test cases, properly inspect code

Framework Rules

  1. Whatever the language, have a way to pass (on a per-thread basis) parameters without modifying the signature of all methods up to the point where the parameters have to be used. An inheritable context of sorts. Example: passing an http timeout to a third party http client library.
Personal tools