TypeScript is a statically-typed superset of JavaScript introduced by Microsoft in 2012. It’s a language that some developers love to hate, but over the years, TypeScript has won over many sceptics, becoming an essential part of many modern JavaScript projects.
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.
Of course, not everyone loves TypeScript, and that’s perfectly okay. However, for those who are still hesitant to try it out, it’s worth noting that TypeScript offers many benefits and is a tool that can make developers’ lives easier. With its static type checking, better IDE integration, and accessibility, TypeScript has earned its place in the modern JavaScript ecosystem.
The TypeScript haters either started using TypeScript or ran out of valid arguments and had nothing left to say.
I cannot imagine coding Javascript without Typescript. When we started on our current web project, Typescript was available and we embraced it from the get-go. Our team all come from statically typed language backgrounds so Typescript was natural and obvious for us. Whilst it is not a formal mantra of ours or anything, our general stance is to always prefer code that a compiler will error on than waiting later for a runtime error.
I suspect people who started with Javascript and were happy with its “change the world” nature felt aggrieved by the constraints imposed by Typescript. For example, we would rarely if ever take a Javascript object and throw some extra properties into it just because we can.
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#).
I can’t remember the last time I wrote plain Javascript, to be honest. I mean, TypeScript isn’t too dissimilar to Javascript, but the typings which give you that awesome IDE support and compiler safety are unrivaled.
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.
If you use a strongly typed language like Microsoft’s C# for backend development, then Microsoft’s Typescript is a true blessing for Frontend JS development.
For others like me, who come from non-typed language like Microsoft’s VFP, Typescript is a pain!.
For me, as a sole developer, modern editors are enough to point out most of the JS errors that TS attempts to resolve. I have been coding for the past 30 years and I will do anything to speed up my coding experience. I tried my best and spent lot of time to use TS – but I spent most of my time in making TS happy instead of actually solving business problems of my end customers.
The word ‘hate’ is a strong word. I don’t hate it. I simply do not use that tool in my development as I can churn out the end result faster and keep my paychecks coming 🙂