4 ms·
With regards to definitive benefit that's backed up by scientific study (rather than just anecdote)-- the UK's Ministry of Defense commissioned a study (IV&V) o
by iheartmemcache 11y ago
With regards to definitive benefit that's backed up by scientific study (rather than just anecdote)-- the UK's Ministry of Defense commissioned a study (IV&V) on the error rate of long-lived code comparing C code bases (static but not too strict) vs Ada (static and fairly strict). They presented their findings Ada-Europe 2001. There was about a 1 to 10 error ratio. They subset the Ada code into formally verified by SPARK code, and the error rate -- I kid you not -- dropped another order of magnitude. I'd assert based on that study static typing is definitively more reliable when your problem domain is set in stone [the operational semantics of flight, stock markets, power plants]. Of course that doesn't extend to any 'exploratory' computing where your domain isn't strictly (pardon the pun) defined.
RE: Parametric polymorphism being "useful" - a pedant like me would claim for it to be of use, one has to demonstrate one clear instance of PP being of use - trivial or not - after which PP gains the attribute "useful" ;)
- kazinator 11y agoBased on that study I would assert that tight static typing is more reliable than static typing that is full of holes. It doesn't speak to strong dynamic versus strong static at all. Speaking of holes, of course dynamic typing can have holes also: if an interpreter or compiler misses a type check, the consequences are that the wrong operation is applied to an object. The result is corruption, crashing. The correctness and completeness of a type scheme is orthogonal to static versus dynamic.
- seanmcdirmid 11y agoThis UK study is an anecdotal data point. It is not a controlled study, it is just comparing project A to project B that differ, among other thing in the languages they were written in (and probably much more!). It doesn't tell us very much for sure, but again adds to the anecdotes that can shape our judgement. Of course, useful has a low bar, but it also has a magnitude (X is useful if it is used, it might not be very useful though). Incidentally, stock markets have been big on Lisp and Smalltalk, two languages not known for static typing. It turns out that language X is always used in the stock market, where X is the latest hot language (Scala, Haskell, Clojure...).