Eric Elliott
1 min readDec 31, 2016

--

If lives depend on a system it’s even more important to prioretize bug reduction measures based on what we know works. Here are strategies that all have much stronger correlations with lower bug density than static types:

  1. Code review, collaboration, and knowledge sharing (each hour of code review saves 33 hours of maintenance)
  2. TDD (40% — 80% reduction in production bug density)
  3. Daily continuous integration (large code merges are a major source of bugs)
  4. Minimize developer interruptions (an interrupted task takes twice as long and contains twice as many defects)
  5. Linting (catches many typo and undefined variable bugs that static types could catch, as well as a host of stylistic issues that correlate with bug creation, such as accidentally assigning when you meant to compare)
  6. Reduce complexity & improve modularity — complex code is harder to understand, test, and maintain

… #? Static types do correlate (a little) with reduced bug density, but the effect is small — a tiny fraction of the benefit you’ll get from everything else on this list.

If lives depend on your code, and you can add static types without adding a lot of complexity, and you have the resources to commit to proper training, it may be worth using static types — but do all those other things first.

--

--