I'm Brett Slatkin and this is my personal blog. I write code. These are my projects:

14 July 2012

How to write code effectively

  1. Decide on the single thing you care about the most and make it work
  2. Write a test for that important case
  3. Sketch out many other tests for cases you think could be important
  4. Rewrite the code two or three times while filling in the tests
Crucially, if you don't do #3, you can never do #4 because you won't know if your rewrites will be correct. Tests are insurance against making mistakes. They take time, but they let you move faster ultimately because you can be more confident in taking risks, which is the whole point anyways.

4 comments

Leave a comment