TypeScript has been increasing in its popularity for the last couple of years. It’s mentioned among the five most promising languages in 2020. Angular, one of the largest frontend frameworks, is using TypeScript. About 60% of JS programmers already use TypeScript, and 22% wish to try. Why?
What is TypeScript?
- You can avoid masterfully-hidden-ninja errors like the classic
'undefined' is not a function.
- It is easier to refactor code without breaking it significantly.
- Orienting oneself in complex, large-scale systems is not a nightmare anymore.
The freedom of dynamic typing often leads to bugs that not only decrease the efficiency of the programmer’s work, but can also grind development to halt due to increasing costs of adding new lines of code.
1. TypeScript is more reliable
2. TypeScript is more explicit
Making types explicit focuses our attention on how exactly our system is built, and how different parts of it interact with each other. In large-scale systems, it is important to be able to abstract away the rest of the system while keeping the context in mind. Types enable us to do that.
Overall, TypeScript is a great tool to have in your toolset even if you don’t use it to its full capacity. It’s easy to start small and grow slowly, learning and adding new features as you go. TypeScript is pragmatic and welcoming to beginners, so there is no need to be afraid.
I hope this article will be useful in your TypeScript journey.