Reviewed by Greg Wilson / 2021-09-08
Keywords: Programming Languages
Way back in 2012 we reviewed Hanenberg2010, which found that (under very specific and carefully explained circumstances) the use of static typing did not make programmers more productive than the use of dynamic typing. However, in a later paper (Hanenberg2013), researchers looked at, "…whether static type systems improve the maintainability of software systems, in terms of understanding undocumented code, fixing type errors, and fixing semantic errors" and found that, "…static types are indeed beneficial to these activities, except when fixing semantic errors." Digging deeper, they found that, "…developers using a dynamic type system tend to look at different files more frequently when doing programming tasks—which is a potential reason for the observed differences in time."
Addendum: one other interesting study of static typing is Fischer2015, which looked at whether the benefits of static typing are due to better code completion in the IDE. The answer appears to be "no", i.e., whatever effect static typing has is because of the typing itself, not because it helps a modern development tool do the right thing when you press the tab key. Teasing apart possible confounding factors like this is central to any modern research program; if anyone knows of an up-to-date summary of related research we'd be grateful for pointers.