-
I think there's a limited set of circumstances where strong static type checking is useful for actually catching errors. Mainly, I would want strong type checking in an application which had to run unattended, had to never crash, and had to always be right.
But maybe that's just the residue of my java/c++ schooling. I can't imagine myself actually ever choosing to design a statically typed system again.
Also, nice to see you post again.
-
[...]If checking types was so important, then one would expect that this would be done a lot in unit tests.[...]
In fact you see this argument made by static typers all the time: "Users of dynamic languages must add extra tests to your unit tests just to check the type. Therefore the time savings in using a dynamic language is lost because of the extra unit tests."
As you point out, it just ain't true. You don't end up writing more tests for a dynamic language.
-
It doesn't really matter if your program is manifest typed or not, if you don't test that all code paths get adequately covered in your testing process, then there is no way in hell you are going to be able to trust that it will "run unattended, never crash, and always do the right thing".
-
the point is: you don't check for types explicitly, you check for correctness of stuff.
But if you see something like:
AttributeError: 'list' object has no attribute 'split'
in you unit tests you suddenly think: "oh, wait I missed something" and go fix it.
The strong typing guys seem to think that you can't live withouth static (supposed) safety, but too much often the dynamic guys go on with their "ah, no I don't need this", even if all the big dynamic systems have some kind of optional type checking (modern smalltalks have protocols, zope and twisted have interfaces, Common Lisp has soft typing).
And btw, are'nt pychecker/pylint small, little powerful static checks?
Don't fall in the trap of thinking dynamic typing is perfect, the worls's just waiting for a system es axpressive as dynamic ones with a lot more static checks :)
-
Well, having looked into Boo.. I think the primary claim for static types is that the compiler can generate faster (but specialized) code....