4 ms·
There are some things you can enforce with a type system that you cannot practically implement with unit tests. For example in [1] it is described how a type s
by anonymouz 13y ago
There are some things you can enforce with a type system that you cannot practically implement with unit tests.
For example in [1] it is described how a type system can be used to help you keep track which kind of string contains what data (SQL, XML, user input...) to catch problems with injection attacks at compile time.
[1] http://blog.moertel.com/posts/2006-10-18-a-type-based-solution-to-the-strings-problem.html http://blog.moertel.com/posts/2006-10-18-a-type-based-soluti...
- dchichkov 13y agoA type system like this can create a lot of drag, when, say, you need to interface to an external library and suddenly discover that this library, annoyingly, only works with strings, not your data types. In this case you might have been better off, just by keeping name conventions straight. Still. Yes. Your point is certainly valid.