3 ms·
Generally I find that the bugs that are easy to find with tests and the bugs that are easy to find with static types are different. I don't think we disagree m
by orangecat 6y ago
Generally I find that the bugs that are easy to find with tests and the bugs that are easy to find with static types are different.
I don't think we disagree much. As your experience shows, trying to replicate type checking via unit tests is almost always impractical. Which means the tradeoff of not having static typing is not that you're writing more tests, but that there's an increased chance of bugs.
And I agree that once a JS project is large enough to have a build process, the benefits of TypeScript almost always outweigh the costs. I'd even like to see JS interpreters allow and ignore TypeScript types, so you could use it without a build step.