Re:Language Design Deal Breakers
by TheEzEzz on Saturday May 25, 2013 @08:46PM
(#5769521)
Yes, but this requires the additional steps (and work) of making the changes to your tests. Tests give a good approximation of what static analysis gives you, but it is more cumbersome. (Of course tests can also do things static analysis can't)
[ Parent
| on HN ]
Re:Language Design Deal Breakers
by michaelochurch on Saturday May 25, 2013 @08:59PM
(#5769566)
I usually write a macro (defn-typed) that generates pre- and post-conditions (contracts, essentially) for crucial APIs when I'm working in Clojure.
It's not as good as static analysis at catching all type errors-- if that's what you need, I wouldn't recommend any dynamic language-- but it does mean that most type errors will be caught in unit testing, with minimal recurring work.