Skip to content

Comment on What Dynamic Typing Is Forparent

Comments

I took over maintenance of a big untestable program in Python once (a build system). None of it was designed for testing and every change I made would trigger some bug. The cost of running the whole program was about an hour of building so every tiny problem was incredibly frustrating.

I thought adding types might help to remove the most trivial mistakes and help me get it into shape faster. All I can say is that it didn't. The easiest mistakes to make were not the kind of things that triggered typing issues.

When I bit the bullet and found some things that could be made testable - only then did the burden start to fall and to sort of exponentially disappear. Each test, crappy and incomplete as it might have been, made it easier to refactor so that the next test could be added. I went from system tests inwards towards unit test because this, again, had the biggest benefit/cost.

So my thesis is that big general tests do more for you at the start and honing in towards more detailed ones returns less and less value. In this model I see types as being fairly detailed level tests so they can happen later on. This is a facetious, throwaway idea that just occurred to me so don't take it too seriously.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.