You now have developers that once hated TypeScript liking it. Perhaps one of the most known developer advocates to get their TypeScript stance wrong was Eric Elliott, who published an article where he discusses a TypeScript tax. To Eric’s credit, he doesn’t say not to use TypeScript but attempts to argue against its use.
One of the most significant benefits of TypeScript is static type checking. By enforcing types at compile time, TypeScript can catch errors that might have gone unnoticed until runtime. This can save a lot of headaches and debugging time. It also makes code more maintainable and understandable since the types serve as documentation for the code.
Another benefit of TypeScript is that it offers better IDE integration. With proper configuration, TypeScript enables editors to provide more accurate code completion and documentation, making writing and understanding code easier. This is especially useful in larger codebases with many dependencies.
But it wasn’t always sunshine and rainbows for TypeScript. When it was first introduced, many developers were sceptical. They saw it as an unnecessary layer of complexity that only added more work to their already busy schedules. And while some of these developers are still around, many have since come to the idea that TypeScript has a lot of value.
So, what changed? For starters, Microsoft has been committed to continuously improving TypeScript. Each new release addresses issues adds new features, and refines the language. This has gone a long way in winning over sceptics concerned about using a language they felt was still in its infancy.
But there’s more to it than that. TypeScript has also evolved and become more accessible to developers over time. It’s easier to set up, with straightforward installation and configuration. As more people have started using TypeScript, the community has grown and become more supportive. There are plenty of resources and helpful developers out there who are willing to lend a hand.
Furthermore, TypeScript has significantly increased in popularity with high-profile projects such as Angular, Vue, and Aurelia. These projects have adopted TypeScript, demonstrating its power in real-world applications. Seeing how these projects have benefited from TypeScript has encouraged many developers to try it.
The TypeScript haters either started using TypeScript or ran out of valid arguments and had nothing left to say.
My single gripe about Typescript (which might now be solved as we’re on an earlier version) is there is no easy way to check an object if it realised a specific interface (equivalent of the “is” operator in C#).
For me, the original issue was speed – I’m now 2 Moore’s Law generations since we first turned typescript (and Angular) down. Second was how many types were so incomplete or undocumented re: standard DOM, and the fact that what they offered for the standard wouldn’t work if you still had to incorporate an IE hack that wasn’t in the type system.
Lots changed. VSC is fast, type checking is fast (the rest of eslint takes time), types display is almost TOO instant (it can pop up over the code you’re trying to read), and IE is rusting at the top of a pile of plastics somewhere on the ocean floor.