← Back to context

Comment by rpbiwer2

3 years ago

IMO the benefits of TS are huge, but probably the biggest benefit is that refactoring becomes almost trivial in most cases - just change the type of a variable/function/etc and the compiler will tell you every line in your codebase that needs to change in real time.

> refactoring becomes almost trivial in most cases

And when it does not become trivial, it is an indicator it would be borderline impossible without it.

After a rather extensive refactor I once did the compiler gave me over 4.000 typescript errors. It would be a tremendous effort for all of these to be identified and ironed out, probably taking years because many issues were very circumstantial.