Daniel Lemire's blog

, 2 min read

Cool software design insight #1

2 thoughts on “Cool software design insight #1”

  1. Daniel Haran says:
  2. Mark Reid says:

    I also came to the same conclusion after working as a commercial programmer for a few years. When it comes to code “less is more”.

    While it’s not a solution for everything, one thing test driven design does well is make you focus on the features that are essential. The best way to avoid useless features is not write them in the first place!

    Instead, you write simple tests that exercises only the functionality you want and the game is then to implement enough code to get the tests passing and then stop. If you need more features, write new tests and repeat.

    Not only do you avoid unnecessary, over-general code but writing the tests means when you do need to refactor to add new features you can easily check whether the old functionality is still working.