4 ms·
If I was given the choice, I can have either static analysis or types I would pick static analysis every time
by slifin 7y ago
If I was given the choice, I can have either static analysis or types I would pick static analysis every time
- nicoburns 7y agoTypes are just one kind of static analysis. So it makes sense that you'd want the superset rather than the subset.
- naasking 7y agoIt's not so clear cut. Types are compositional, by definition. Static analysis needn't be compositional, and so a small change could cause dramatic and unpredictable long-range effects elsewhere in your code. Figuring out what changed or what went wrong can be a nightmare.
- diegoperini 7y agoI had the chance to experiment this idea a few years ago. I had a text editor which could only lint Javascript. My project was a haskell+js hybrid. There was no analysis for hs aside from running the compiler and seeing the output. Writing the hs part was a nightmare at first. Once the project grew and I needed refactoring, js became the main nightmare. Hs simply did its thing which at that point, I already had got used to it. Js couldn't tell me if anything wrong outside of function boundaries. A smarter js linter may prove me wrong but I believe types serve a long term goal by sacrificing productivity in the beginning.
- OJFord 7y agoI don't understand this dichotomy - type checking vs. all other static analysis? Or unchecked types vs. static analysis without types? Or something else?