2 ms·
Except if you are comprehensively testing your code for things other than what's caught by type checking, you get those validations for free. In my view, type
by pfdietz 6y ago
Except if you are comprehensively testing your code for things other than what's caught by type checking, you get those validations for free.
In my view, type checking lulls one into thinking the code is better than it actually is, just because it compiles. But it doesn't test the algorithms. And testing the algorithms exercises the code enough to reveal the shallow type errors.
- kenhwang 6y agoPositive vs negative testing. Checking the algorithm is generally positive testing. You still should have negative testing, and in a strong type system language the compiler can be leveraged to do much more of that for you. But yes, there's a lull with type checking that makes people believe only negative testing is sufficient, which is as foolish as thinking only positive testing is sufficient.