Fed-up with strongly typing
-
BobJanova wrote:
The C# compiler, and any other compiler for a strongly- and statically-typed language, certainly will check the data type of variables through every possible code path
Neither C# or any other compiler in that category will check dynamically loaded code paths. Where as unit testing would check that.
Unit testing will check the set of code paths that you write the tests to exercise. Fine if you're testing small methods, with only a few possible code paths or edge cases. Then you need to test interactions between your classes, each of which has a dozen methods with 2-5 paths each. Suddenly you have tens of thousands of tests, most of which differ in very small ways. A strong type system enables invariants to be proven efficiently, regardless of the number of possible paths through the code, because it does not need to rely on executing every possible path. A type system is not a replacement for unit tests, and unit tests are not a replacement for a type system.