Hacker News new | ask | show | jobs
by __--__ 4532 days ago
All this talk about formal type theory, but where are the references to the relevant studies? Where's the data? The few studies[1][2][3][4] I've found are inconclusive one way or the other and none of them focus on error rates. I found another conversation about how to go about studying error rate in dynamically vs statically typed languages, but all I really found was this article studying the affect of hair style on language design[5].

[1] http://pleiad.dcc.uchile.cl/papers/2012/kleinschmagerAl-icpc... - maintainability

[2] http://dl.acm.org/citation.cfm?id=2047861&CFID=399382397&CFT... - development time

[3] https://courses.cs.washington.edu/courses/cse590n/10au/hanen... - development time, take 2

[4] http://pleiad.dcc.uchile.cl/papers/2012/mayerAl-oopsla2012.p... - usability

[5] http://z.caudate.me/language-hair-and-popularity/

2 comments

I glanced over the studies you linked to and in all of them, the languages used as examples of static typing are Java, C and C++. There's no mention of type inference or any languages that have a more advanced static typing scheme like ML or Haskell. A lot of it seemed to be a "Java vs. Ruby fight" with a slight bias towards the latter in the authors.

To joke and exaggerate a little, those studies seem to be done by people who belong to the "proponents of dynamic typing" and not "familiar with type theory" bin of people in the Venn diagram in the OP.

I agree completely, that's why I used the word "inconclusive." Still, it's the only real data we have on static vs dynamic typing. Until we get better data, everything is just opinion and preference. Well informed opinions, in the case of those familiar with type theory (which I am not), but opinion nonetheless.
I'm afraid that when it comes to hard science, the static vs. dynamic typing discussion will remain as "inconclusive" for a long time.

The testing methodology in (some of) the studies above involved test subjects to be working in toy prototype programs during a short period of time. In my opinion, this will favor dynamic typing. If there's a simple problem with a quick'n'dirty solution even I do often prefer Python to Haskell.

The real advantages of static typing become apparent only when a project matures as time and effort are spent on maintenance and refactoring. In dynamic languages it is rather easy to break "old" code by making changes to "new" code and subtly changing some types and you have to rely on unit testing to catch this at run time. This class of errors is caught by a sane type checker before you even start running your tests.

So my somewhat informed opinion is that it is very hard to get "conclusive" evidence of the superiority of static typing because it's a very difficult thing to objectively measure in a short period of time. I say "superiority" because that's my opinion that static typing is a little better for most but not all applications.

Are you trolling? I seriously can't tell...