by adimitrov · 7y ago · 0 comments
Plain JS is hell to refactor. Between arbitrary autocasting, little tooling and no useful type system, if you don't have a very detailed test suite, you won't find the parts of your code that are broken now. Also, if you do, you now have to reimplement all those tests that did nothing else than to check your call signatures.
Ease of refactoring is a major indicator for a good enterprise language, as constant refactoring is basically the main development process. If your devs are afraid to touch certain pieces of code because nobody knows what the ramifications are, your software is already dying.
That's why TypeScript is taking off so nicely. People crave those static guarantees that JS doesn't have.
Having good and smarter tests helps more for ease of refactoring than having everything mapped to types. But I might just have seen bad examples of TypeScript codebases.
With the appropriate amount of skill and discipline, however, this stage can be postponed for longer than the life of the application. Typescript is absolutely not required.
The real gain is to be had in pushing the mudball stage as far into the product's life cycle in absolute terms as possible.
In that sense, nothing is required, but some things help. I argue that TypeScript helps.