When should I use TypeScript?
Alex Ewerlöf
27219

I’m well aware that I’ve “drunk the kool-aid” some on Typescript. That being said, to your last 2 points as Typescript disadvantages, I’d say….

With respect to performance, Typescript is a Javascript superset. Take away the type annotations and what you’ve got is ES6. So there’s really nothing stopping you from doing the same manual optimization in TS that you would do in JS.

With respect to agility of development, I find (though anecdotally) that working in a Typescript project moves much more quickly than in a plain-Javascript project because I don’t have to go look up documentation all the time — the type annotations are my documentation, and my IDE autocomplete works as expected. And typechecking helps speed things up when, for example, I can’t remember if the key I want in the options object I’m passing in is “templateUrl” or “templateURL” or “templatePath” — because the Typescript compiler will tell me if I get it wrong, and my IDE can show me the “type” (shape) of the options object.

Show your support

Clapping shows how much you appreciated Spencer Williams’s story.