⇦ All Posts

Coding Maxims

July 26, 2017

numbered for ease of reference, not for priority

  1. code is debt, and bad code is an unhedged call option (a)
  1. DRY DRY DRY actually DAMP (a) is better

  2. keep it simple (a), especially at first

  3. be consistent

  4. no magic! be predictable

  5. no magic numbers/strings — use constants instead

  6. a good repro is 90% of a bugfix

  7. code is written once, but is read many times

  8. ship early, ship often

  9. first code, then ship, then measure, then optimize

  10. remember the 80/20 rule, and the 90/90 rule

  11. design layers of abstraction with deep modules (a)

  12. prefer encapsulated complexity (a)

  13. write tests. not too many. mostly integration. (a)

  14. comments should describe what’s not obvious (a). i used to hate comments but this book (a) changed my mind.

  15. Postel’s law is wrong — be strict both ways

  16. budget your innovation tokens (a)

  17. tools, not rules. e.g. go fmt (a)

  18. RAT, not MVP (a)

  19. first you don’t know the rules, then you learn the rules, then you break the rules

See also: programming principles, hacker laws (a), Dieter Rams’ principles (a), the Zen of python (a), Urbit precepts (a)

old version here