The argument over static vs. dynamic typing in programming languages is one of those great geek debates that will never be resolved. Like Emacs vs. vi, Picard vs. Kirk, or chalupa vs. taco, it’s become a religious issue, with each side holding firm in their One True Belief.
Ok, I’m exaggerating a bit, but I think it’s fair to say that many people make an either/or choice with type systems. On the side of static typing, there are the formalists who dream of a day where programs can be proven to be correct; and on the dynamic side, there are the pragmatic hackers who want their language to be Agile. These two camps are fundamentally at odds, because there is very little grey area between their goals.
On the other hand, there are definitely some concrete benefits to be had from both approaches. For the graduate psychology class that I took at Carleton this fall, I decided to attempt an analysis of the pros and cons of static and dynamic typing from a usability perspective. Instead of the formalism vs. agility argument, I tackled it from a different point of view, asking “How can type systems make programming easier?”
I looked at several different aspects of type systems, and analyzed them in terms of the Cognitive Dimensions of Notations framework. One of the issues I addressed was mentioned in the post Why I Miss Static Typing.
If you’re interested, you can read the full paper. To give you a better idea of the general flavour, here is the abstract:
This paper uses the Cognitive Dimensions of Notations framework to analyze the usability aspects of static and dynamic type systems in programming languages. It presents seven problems, in the form of patterns, that are often encountered during programming. Solutions are presented for both static and dynamic type systems, and analyzed in terms of cognitive dimensions.