Graham King

Solvitas perambulum

Software engineering practices

software
Summary
I've distilled key software engineering practices that have stood the test of time from my notes taken at an XTC meetup. Keep methods short; ensure your system is always running with live upgrades or a cluster; always maintain a visible goal; write self-documenting code; use verbose test names; let the code function as the design; avoid duplication—twice is a smell, thrice a pattern; eliminate broken windows to combat entropy; check everything into source control; separate changing elements; draft pseudo code as comments or methods; prioritize coding the common case for maximum value; embrace text; have the courage to implement alternatives instead of debating; take breaks; proceed in small, iterative steps; deepen your understanding of the domain; follow the mantra: make it work, then make it right, then make it fast; strive for coherent abstractions; explore legacy systems; automate processes; avoid generic 'Manager' objects in favor of specific roles; and focus on behaviors and interfaces rather than data—no magic or wizards allowed.

A selection of software engineering practices, from notes I took at an XTC meetup many years ago. They have survived the test of time very well. Practices change much slower than tools, and are typically a better investment.

  • Keep your methods short.
  • System should always be running – this means you need either live upgrades or a cluster.
  • Always have a goal in mind – visible task. For example keep you current task on an index card stuck to the side of your monitor.
  • Code should express intent – self documenting code.
  • Verbose test names – Think of test methods names as a sentence.
  • The code is the design.
  • Do not duplicate code, effort, anything.
  • Twice is a smell, three times is a pattern.
  • No broken windows. Fight entropy.
  • Check everything into source control. Tools, libraries, documentation, everything.
  • Separate things that change.
  • Write pseudo code first and keep it as comments if it is still useful. OR, write pseudo code as methods and then flesh out.
  • Code for the common case – focus on building functionality that is the most useful first. 80% value for 20% effort.
  • Text is king.
  • Have courage – don’t talk instead of doing – resolve design debates by implementing the alternatives.
  • Take a break.
  • Proceed in small steps / small iterations.
  • Understand the domain. Better domain understanding lowers communication cost and means you can use vaguer specifications.
  • Make it work, then make it right, then make it fast.
  • Strive for a coherent abstraction – does each ‘unit’ fit together.
  • Open black boxes – look into bits of legacy systems you don’t know.
  • Automate.
  • Avoid ‘Manager’ objects – instead make them more specific: Retriever, Calculator, Finder, etc.
  • Think in terms of interfaces, of behaviour, not of data.
  • No magic: No wizards.