What is Typescript ?
TypeScript is a programming language developed by Microsoft in 2012. Its main ambition is to improve the productivity of developing complex applications.
It is an open source language, developed as a superset of Javascript. What you have to understand by that is that any code valid in Javascript is also valid in TypeScript.
This article provide an overview of the TypeScript language and its features, as well as practical use cases and benefits.
Summary
What is Typescript ? What’s the point ? Who is it for ?
TypeScript is a superset of JavaScript that adds optional static typing, allowing developers to catch errors early in the development process. The main point of TypeScript is to improve the developer experience by providing better tooling and catch more errors at compile-time. It also adds support for features that aren’t yet available in JavaScript, such as interfaces, generics, and namespaces. TypeScript is mainly targeted at large-scale applications and development teams, as it can help reduce bugs and increase code maintainability.
The main point of TypeScript is to provide developers with a way to catch errors and bugs at compile time instead of runtime. By adding types to the code, TypeScript can detect type-related errors during development and prevent them from happening in production. This can save developers time and effort, and can also help to improve the quality and reliability of the code.
TypeScript is primarily designed for developers who work on large-scale JavaScript projects, where the complexity and scale of the codebase can make it difficult to manage and maintain. It is also well-suited for developers who are already familiar with object-oriented programming languages such as Java or C#, as TypeScript shares many of the same features and concepts.
How to deal with these issues ?
One solution could be to add an additional layer to deal with the problems mentioned above, this is where Typescript comes in.
What is Typescript ?
Briefly typescript is an overlay added to Javascript in order to provide a certain number of functionalities such as static variable typing, polyfill or object programming functions such as genericity. Before using your code in production you will see typing errors in your IDE or when compiling the code. In reality we talk more about transpilation than compilation.
You will find more details on the official website https://www.typescriptlang.org/
What do I gain from it ?
By adding typing, we increase the security of its source code, we can know in advance that such an instruction would have caused a crash if we had not used types.
Conclusion
Using typescript you combine the best of scripting language with the best of compiled language. One of the only drawbacks then becomes language performance over pure computing, which in reality in a complex web application is not the biggest impact. You can also always perform some very specific parts, in micro-service in GO for example.