This is the (mostly) no nonesense guide to studies and research that measures and/or compares a variety of facets, characteristics, or manifestations of software development in dynamically vs statically typed programming languages.
Disclaimer: For larger, more complex codebases, I do advocate for statically typed languages that also support algebraic data types, generic types, type classes, and preferrably a form of typelevel expressiveness (e.g. dependent types, refinement types) for larger, more complex codebases.
This alone is not enough for me though. Other practices I advocate for include imposing referential transparency wherever possible, modeling with algebraic abstractions such that laws of the system can be encoded as property-based tests either in a runnable test suite or in the type system itself (as with, for example, Idris), using some form of example-based tests to capture edge conditions. However, I have been known to write a lot of Bash for simpler glue logic, so much so that I wrote a Bash styleguide here: https://github.com/mbbx6spp/styleguides/tree/master/bash. I also write much Nix for the infrastructures I deploy.
Previously in my career as a developer I wrote Ruby (relgiously TDD-style) to build Rails web applications and advocated in favor of code-level practices that I read in disgust now. Forgive me father, for I have sinned.
Observations of results
- Measuring things like proness to creating bugs, developer productivity, or otherwise effectiveness of type systems is a hairy tasks (to say the least) to design valid experiments for.
- The scope of the experiment is inversely proportional to how precise the result can be (i.e. the larger the scope, the smaller probability the result holds in all operating environments).
- The results I am presently aware of in this space are not conclusive towards one side or another. In fact, there are some results that offer mixed findings.
- Many experiments or research studies in the area that compare dynamically and statically typed languages tend to target the lowest common denominator kind of statically typed languages which are mainstream such as Java and C.#
- Unit Testing Isn't Enough, You Need Static Typing Too: http://evanfarrer.blogspot.ca/2012/06/unit-testing-isnt-enough-you-need.html?m=1
- On The Revival of Dynamic Languages: http://link.springer.com/chapter/10.1007%2F11550679_1?LI=true
- Static Typing Where Possible, Dynamic Typing When Needed: The End of the Cold War Between Programming Languages: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.69.5966&rep=rep1&type=pdf
- Improving Software Quality With Static Analysis: http://www.cs.umd.edu/~mwh/papers/paste41gp-foster.pdf
Related (Statically Typed Background)
This is where my current bias will likely show up the most since I am more likely to be exposed to pro static types or at least pro static analysis papers:
- On understanding types, data abstraction, and polymorphism (1985): http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.117.695
- Idris, a General Purpose Dependently Typed Programming Language: Design and Implementation: https://eb.host.cs.st-andrews.ac.uk/drafts/impldtp.pdf
- Practical Erasure In Dependently Typed Languages https://edwinb.wordpress.com/2015/02/28/practical-erasure-in-dependently-typed-languages/
These are just pointers. If you have a relevant paper, experiment, or study please link to it in the comments and I will add to this list.
"To Type or not to Type, that is the question."
Make your own mind up. My suggestion is above in the disclaimer.