re: Static Typing vs Testing == Apples vs Oranges VIEW POST


Where have people been advocating that you don't need tests if you have a type system? As your article demonstrates very well, a type system only prevents you from having to write tests that ensure the function only works with the correct inputs types and returns the correct type. Or said perhaps said slightly more eloquently:

Tests should be testing for logic errors. The benefit of the type system is that you no longer have to write tests to validate function inputs and outputs. You still need tests for logic.


I have been privy to such discussions on social media involving knowledgeable folks taking extreme positions on both sides.

Yes, as of today, each have their strengths and weaknesses. This may change in the future. Until then, it is best to embrace them both :)


Do you have any links to someone taking an extreme on either side? I'd like to see their arguments.

These were remarks/threads I have seen on Twitter. So, unfortunately, nothing recorded :(


By the way if you read his blog you'll also find interesting stuff on this subject and others (like formal proofs)

I am not saying Hillel or any static typing proponents are wrong. Having worked on program analysis/verification and formal methods, I am saying we need to have a broader and more permissive perspective. Instead of saying "static typing is the end all", it may be better to understand why we operate the way we do and be pragmatic about what it takes to get from where we are to where we want to be.

code of conduct - report abuse