[Haskell-cafe] Dynamic typing makes you more productive?

carmen _ at whats-your.name
Tue Mar 18 15:54:31 EDT 2008


> > is probably the wrong thing to do. Static typing makes it harder to
> > maintain software because it's harder to change it."

ive found Ruby code is harder to change. you have to invest a significant amount of time duplicating virtually every expression in your entire system in test-form (with mocks, stubs, asserts, runtime-reflection comparisons etc) just to get something approaching the youd get from rigorous static-analysis/typechecking tooling. plus it all assumes you wrote your tests perfectly, and you have to invest time learning the various tools (all the needs here are at least as much mental load as learning about typeclasses) for that, etc.

if you don't do all that, theres the nagging feeling that something may have broken somewhere. and theres still that possibility, given all the possibilities with instance_eval, module_eval, method aliasing, even module include order (its difficult/impossible to figure out where a function came from, which version it is, etc). the ultimate solution i think is an enhanced/sandboxed interpreter/VM which gives you a readout of all the possible type errors that _could_ occur at runtime, given all the runtime dynamism thats allowed. i should investigate what SmallTalk has come up with, but lack the time/funding/reinvention-interest to re-create all this for Ruby, especially as it would involve becoming intimately faimilar with Rubinius and/or MRI as well..

ive also found it virtually impossible to change other people's code since it requires getting used to their metaprogramming style and tricks, but maybe using _why's projects arent a good indicator of the greater Ruby community. ive seen plenty of Ruby code that reads almost like Java, and i wonder why they would even bother when they can get a much faster VM and better tools (especially wrt refactoring)  by just going all the way.

change might be easier, on paper, by a few characters. if you ignore all sorts of real factors.


More information about the Haskell-Cafe mailing list