TypeScript overview
TypeScript is an open-source object oriented language developed and maintained by Microsoft. As its name suggests it is related to JavaScript. It extends JavaScript by adding features which originally JavaScript lags. TypeScript was first released in October 2012.
Why to use TypeScript
JavaScript is a programing language used primarily by web browsers to create a dynamic and interactive experience for the users. But like every other programing language it has its own flaws which leads the developers in spending more time in debugging than coding.
TypeScript solves a major portion of problems in JavaScript. TypeScript simplifies JavaScript code, make it easier to read and debug. In the following way.
TypeScript adds a robust system of types TypeScript. If you are from a typed language background like c, c++, java then you will know that in JavaScript there are no types by default. That means it is very easy to make errors in JavaScript like syntax, code logics or passing wrong parameters in function all those errors can only be found during run time which is not a good thing. Secondly, JavaScript is much more flexible than any other language. In JavaScript you can access any property or entity it exist or not tto any other object or entity.
Due to these problems JavaScript is not considered as a good option to build a highly scalable product.
Note:- All the code written in TypeScript will ultimately get converted into JavaScript.
Features of TypeScript
1. Object oriented language : TypeScript provides all the features of object oriented language must provide like classes, interface and module.
2. Static type checking : TypeScript uses static typing. This helps to reduce error making.
3. Cross-platform : you can run TypeScript on any platform that supports JavaScript. It can be installed on mac, linux and windows.
4. Rich IDE support : with the enhance IDE support with TypeScript we get intellisense support, ability to refactor code easily and the red line whenever there is an error we also get description of the error.
Tech giants who uses TypeScript
2830 companies reportedly use TypeScript in their tech stacks, including Slack, Vox Media, and Stack.
Angular is a modern framework built entirely in TypeScript, and as a result, using TypeScript with Angular provides a seamless experience.
TypeScript is now officially google supported language.