Strong static typing, a hill I'm willing to die on
We want to identify and fix problems as early as possible; ideally, before we even write them. Problems cost exponentially more to fix the later you catch them, and the damage they can cause only grows with time. Static typing lets you identify problems earlier than dynamic typing, full stop. In fact I&#x27;d rather have strong static typing and 0% test coverage than dynamic typing and 100% test coverage -- in the latter case, I&#x27;m catching problems much later, and I have the maintenance burden of all those tests, 70% of which are only there to catch what static typing would have already found.<p>The best mix for me is to lean heavily on the type system and only lightly on tests, trying to write code that is simple and &quot;obviously correct&quot;. Obviously-correct code has already had its problems ironed out in the first 6 or so bullets below, and there is very little room for further bugs to hide. Of course even &quot;obviously correct code&quot; can actually have bugs or be subtly incorrect -- a better definition is that any surprises in such code would <i>also</i> be surprises to the tests. The tests are nothing more than mirror images of the code, and therefore are not helpful or necessary. Static typing helps me think about the problem clearly, and helps me write &quot;obviously correct&quot; code.<p>Here&#x27;s my working list, in order of preference of when I&#x27;d like to find the problem. Every time you drop down this list, the cost to fix the problem gets multiplied by some small factor ~1.5 to 3.<p>- Initial ideation  [&quot;Facebook for dogs? That idea sucks.&quot;]<p>- Requirements analysis  [&quot;That&#x27;s not actually how we calculate that metric.&quot;]<p>- Conceptual system design  [&quot;Wait, these parts don&#x27;t fit together like that.&quot;]<p>- Low-level design [&quot;Crap, a loop won&#x27;t work here, I need a different flow.&quot;]<p>- Brain-to-fingers typing  [&quot;Whoops I almost typed &#x27;elesif&#x27;&quot;]<p>- Immediately post-typing  [Red squiggly line under &#x27;elesif&#x27;]<p>- Re-reading  [&quot;Wait that should be i-1, not i&quot;]<p>- Compile time  [&quot;SYNTAX ERROR: Unknown identifier &#x27;elesif&#x27;&quot;]<p>- Unit test time  [&quot;Assertion failed: expected 7, got 8&quot;]<p>- Code review time  [&quot;You didn&#x27;t handle the case where N is negative&quot;]<p>- Merge &#x2F; integration test time  [&quot;Oh crap, David&#x27;s commit broke my commit! How the hell do I merge this?&quot;]<p>- Internal manual testing time  [&quot;You need to tighten up the graphics on level 3&quot;]<p>- Production  [&quot;The users say the application keeps crashing when they run this report! Fix it!&quot;]<p>- Years later&#x2F;never  [&quot;It turns out that the analysis code we&#x27;ve used for the last 10 years had a major bug in it the whole time and we&#x27;ve been giving wrong numbers to a regulatory agency that has the power to shut down our company.&quot;]