Programming 101

  • Keep as close as possible to reality. If teaching someone about apples, give them apples.
  • Version 1. Input -> [Do something here] -> Output
  • Version 2. x -> f() -> f(x)
  • Premature optimization is the root of all evil. – Donald Knuth
  • Make it correct, make it clear, make it concise, make it fast. In that order. – Wes Dyer
  • Don’t Repeat Yourself (DRY)
  • Always be in a position to undo
  • A function is always too long
  • A method is always too long
  • A class is always too long
  • Simplicity is prerequisite for reliability. – Edsger Dijkstra
  • Computers, and people must not be left unattended
  • If this side is the same as the other side; whatever you do to this side, you must also do to the other side.
  • Legacy code is code you wrote more than 10 minutes ago. – Justin Beal