News for hackers. Stuff that matters.
Re:Bruce Eckel: Strong Typing vs. Strong Testing (2003) by geophile on Tuesday September 21, 2010 @05:22PM (#1714162)
I agree with almost everything in this article, except for one crucial point. The article says "And if a Python program has adequate unit tests, it can be as robust as a C++, Java or C# program with adequate unit tests."

So what is an "adequate" unit test in Python? I know some advocates of weak typing who believe that the unit tests should include tests of expected input types. 99+% of the time that's going to mean checking exactly what you'd get from static type checking. Rarely, there will be something more complex, e.g. the foobars variable can reference a FooBar object or a list containing 0 or more FooBar objects. (And then I'd question the design of the API.)

I really don't want to write those unit tests. I'd much rather have the compiler do that testing for me.

There are no comments on this comment yet.