A while back I read an article about how static typing does not prevent bugs being added to software. The article is appropriately named: The broken promise of static typing. The author conducted research by generating and comparing ‘bug density’ scores for GitHub repositories. The bug density score was determined by getting the average number of issues labelled ‘bug’ per repository. The results showed that there were not any less bugs in statically typed languages vs dynamically typed languages. The author concludes on the results:
“the lack of evidence in the charts that more advanced type languages are going to save us from writing bugs is very disturbing.”
While this article brings up good points and makes an effort at original research, I’ve always felt that the claims made were wrong. I strongly believe less bugs will occur when a statically typed language is used. However, I’ve never had any proper evidence to back up my claims…until now!
While these results show a benefit from using static typing, people will continue to prefer a specific type system. So, let’s hear from you! What type system do you prefer, and why?