[prev] [index] [next]

Interface Design Rules

Kernighan/Pike's rules for interface design ...
  • Hide implementation details.
  • Choose a small orthogonal set of primitives.
  • Don't reach behind the user's back.
  • Do the same thing the same way everywhere.
  • Free a resource in the same layer that allocated it.
  • Detect errors at a low level, handle them at a high level.
  • Use exceptions only for exceptional situations.