It Depends on the Project
Of course it does.
There is never one answer for everything, and this is no different. That being said, there are a few criteria or “flags” that help me select when I want to use one over the other.
When to TypeScript
I fall to TypeScript when I am writing more than one or two code files or if I’m writing code that I expect someone else to have to run. Although I use TypeScript, the it’s not necessarily the language itself that I want, but the TypeScript compiler as it helps the other developers running my code, and removes the ambiguity of types between functions or classes that need to work togther.
It does a lot of stuff for me:
- Catches errors, especially typing ones, at compile time rather than run time
- Sets standards around what JS-like conventions I want to use
- Better legacy browser support
- Supports multiple module practices
Ultimately, that compiler is powerful and I put a lot of trust into it considering I expect that the compiled code to be optimal.
Yes. Yes it does.
The catch is that the compiler is not as thurough as it is with TypeScript. When you add the
Using TypeScript with the TypeScript compiler gives you that little bit of extra help in development, and that is really where the value comes in for me.