Staying sane while writing software

June 22, 2014September 16, 2016

This is a collection of principles, techniques, and paradigms that lead to useful, quality software while preserving the sanity of the programmers writing it. Mental health and project success go hand-in-hand.

Not all of the principles mentioned here can hold in all cases. Some may conflict in a particular setting. But where possible, applying these ideas seems to lead to the most satisfying results.

Currently this is just an outline.

Attributes of desirable software

What most people (should) want

  • features!
  • customization
  • privacy
  • security
  • robustness
  • performance
    • responsiveness
    • low resource consumption

What programmers also want

  • repeatable behavior
  • incremental effects
  • local reasoning
  • easy rearrangement
  • generalization
  • efficiency
  • scalability
  • consistency

Qualities that help satisfy these desires

Relatively abstract

  • monotonicity
    • accumulation described by sets or, more generally, lattices
  • idempotence
  • commutativity
  • associativity
  • orthogonality
  • composability

Somewhat more concrete

  • principle of least authority
  • declarative description
  • redundancy
  • tolerance
  • isolation

Some techniques that can provide these properties

Broad concepts

  • modular design
  • decentralized authority
    • distribution of resources, labor and responsibility
  • granular delegation of authority
  • clear, incorruptible sources of truth

More specific architectural choices