Hacker News new | ask | show | jobs
by exDM69 4533 days ago
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.

1 comments

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.