3 ms·
Dynamically, but there are some libraries out there that are working to bring static analysis on steroids to spec-enabled code. And as spec is opt-in, you can
by kimi 9y ago
Dynamically, but there are some libraries out there that are working to bring static analysis on steroids to spec-enabled code.
And as spec is opt-in, you can spec just how much (or little) you find useful.
- ngrilly 9y agoInteresting. Any link?
- kimi 9y agoSure: https://github.com/arohner/spectrum https://github.com/arohner/spectrum I think the main advantage of a type system (e.g. Java's) is that it avoids a lot of stupid mistakes; and therefore does help refactoring because most "stupid" changes will simply not compile (rename a function but forget it's used in 3 other places? boom) Static analysis with Spec might be a great booster because it gets you the expressiveness of Spec to static code reasoning.
- ngrilly 9y agoThanks for the link. I've used static and dynamic languages. When using a dynamic language, I usually don't miss static language features, except when refactoring and/or maintaining a large code base. It's the reason why I'm interested by Flow and TypeScript (in the JS ecosystem), mypy (in the Python ecosystem) and even static languages like Go. It's also the reason why I'm a bit reluctant to invest in Clojure, despite being interested by the language.