Re:Ask HN: Is it worth it to invest in learning TypeScript?
by masalachai on Monday November 08, 2021 @09:28PM
(#29157011)
Yes, the incremental refactor does appeal as a solution and we have been considering it.
Two potential drawbacks that were brought up are when there's a business "priority", the refactor will take a backseat, especially if the file is fully in JS.
The other is that with a larger codebase, this could take a year or even more and still not be fully done. But this is mitigated to a large extent by the fact that TS and JS can coexist and the benefits of a TS file are immediately available.
Thanks for your input!
Just as an aside, the amount of bugs I've found just by refactoring to TS is incredible, the compiler has made me aware of edge cases that I hadn't thought of. Just adding types to old code and getting red squiggles telling me why it won't compile has taught me quite a lot about random aspects of JS that I've never considered.