logoalt Hacker News

ulrikrasmussentoday at 10:27 AM0 repliesview on HN

There's also another strong argument against favoring tests over types, which is maintainability. If I go ahead and change a variable type from being non-nullable to nullable, I instantly get a complete list of all the places where I have to handle that, which makes it much much faster to generalize the logic. But in a dynamic language, all tests that were written by the previous developer was written at a time when this variable was assumed to never be null and uses non-null values for all test vectors, so good luck using that to find the places that need to be fixed.

On top of that, every test that could have been omitted due to a type system incurs an extra maintenance tax that you have to pay when you change the API.