3 ms·
>> No they're not. Language without static type checks end up with unit tests as an ersatz type check. Not so. Checking that an object has a certain property o
by jondubois 8y ago
>> No they're not. Language without static type checks end up with unit tests as an ersatz type check.
Not so. Checking that an object has a certain property or method is very different from checking if the object is of a specific type. Also, in any case, these kinds of assertions are best inside the test logic than inside the source code. Source code should be about raw logic - verification of the correctness of that logic is the job of tests. So dynamic typing has better separation of concerns.