|
Python is strongly typed, it just pushes type checking to the last possible second.
The idea that you catch _more_ errors up front is a nice theory. However, people like Bruce Eckel that that as well but now seem to disagree.
My take is that compile time typing introducing much more errors than it saves. Also, type checking is a very weak form of error checking. What you want is an easy way to write REAL tests.
Python can be written much faster than C++, which means it is that much easier to do testing, rather than rely on the false illusion of testing with typing.
Check out Eckels article on Strong Typing vs. Strong Testing.
http://mindview.net/WebLog/log-0025
Here is an excerpt:
That is to say, if a program compiles in a strong, statically typed language, it just means that it has passed some tests. It means that the syntax is guaranteed to be correct (Python checks syntax at compile time, as well. It just doesn't have as many syntax contraints). But there's no guarantee of correctness just because the compiler passes your code. If your code seems to run, that's also no guarantee of correctness.
The only guarantee of correctness, regardless of whether your language is strongly or weakly typed, is whether it passes all the tests that define the correctness of your program.
|
http://www.artima.com/intv/strongweak.html
I find the collections example at the end of the first page, prety good.