5 ms·
This is wrong; tests and type systems have different purposes. One helps prevent logical bugs and regressions in your code, while the other enforces the correct
by RussianCow 5y ago
This is wrong; tests and type systems have different purposes. One helps prevent logical bugs and regressions in your code, while the other enforces the correct use of code and data structures. They overlap a bit, but all the unit tests in the world can’t give you the guarantees that a type system does. And that’s without even mentioning the benefits to discoverability and documentation that a static type system gives you.
- Supermancho 5y ago> This is wrong; tests and type systems have different purposes. For decades, companies have prospered without a strong type system and using tests for type assurance ad hoc. Usually when it's worrisome or has been problematic. You can say it's wrong (conceptually, theoretically, etc) and yet it people continue to do it. That's interesting to think about.
- whynaut 5y agodon't think it matters since the upthread discussion is more about understanding and refactoring code, not ensuring correctness.
- Tade0 5y agoTests are a great way of explaining how a system works. Arguably better than types in some instances. In any case I would refrain from using absolutes like "wrong" for something that clearly works for some people in certain circumstances.