Listen to this story
The two main types of typing in programming languages are static typing and dynamic typing. Static typing means that the language checks the typed variables for correction before running the program. Dynamically typed languages, on the other hand, only check for type correctness while the program is running.
By using a static typing method, enterprise users could develop well-structured programs that would check types before running. This not only saves development time, but also ensures that mission-critical applications run smoothly. The static nature of the language also allows the implementation of better code structuring and other object-oriented programming techniques.
To avoid compatibility issues, TypeScript code is compiled into JS code through a process known as trans-piling. This ensures inter-compatibility between both languages, with TS being able to pick up on JS code natively and JS accepting trans-piled TS code. Most, but not all, libraries made for JS are also compatible with TypeScript (more on that later.)
Is Typescript Winning?
TypeScript also sky-rocketed in developer usage over the years, as seen by this graph taken from the 2020 State of JS report. In the 2021 State of JS report, 69% of respondents chose TypeScript to be their preferred language that compiles to JS, with the second place, Elm, only receiving 2.4% of the votes. The language also has consistently placed in the top 5 of languages developers love and wish to use in Stack Overflow’s yearly surveys.
However, even as TypeScript has garnered considerable love from developers, it comes with its own set of limitations. As it is a statically typed language built on top of JS, it not only requires prior knowledge of JS but also knowledge of OOP concepts, along with scripting know-how. Moreover, it is more suited to deployment in large teams, with most solo developers choosing to stick with JS because of its considerably larger community and relatively simpler code.
Moreover, not all frameworks are supported by TypeScript, which means that certain applications which require obscure frameworks need additional configuration to get working properly with TS. TypeScript is also competing against other alternatives like ClojureScript and Scala for developer use.