What is typescript and why it is inevitable to adapt it in 2021

In this article you will learn why it is very critical to adapt it in both your frontend and backend solutions

Typescript is now the new standard for scalable and maintainable web / mobile / desktop apps

So what is typescript ?

typescript is essentially JavaScript with super powers. Microsoft created typescript because they wanted the flexibility of javascript and the robustness of a typed language that can scale and handle large enterprise project.

Typescript is the second most loved programming language according to a stackoverflow survey of 2020

you might be wondering why Typescript ? Here are some reasons why:

When writing a program In JavaScript, I think that everybody often wonders “what fields are in this object?” or “what arguments this function accepts?” — these things slow us down. We have to go through multiple files to find out where the value comes from. With TypeScript, these problems are gone (unless you’re not using it properly and placing any everywhere).

with typescript you get perfect code completion and assistance as well as a self documenting code that is well structured and self explanatory. just try it out :)

That won’t be the case when you are refactoring in typescript

If you want to use TypeScript, it’s very easy to get started with. Or maybe you already are developing an application for some time that’s already written in plain JavaScript? You can introduce TS to your existing project incrementally because it compiles also .js files. No need to rewrite your whole code.

AOT Compilation is much faster at runtime than JIT compilation

TypeScript does everything during compilation time, so it doesn’t have a negative effect on runtime performance.

One of the examples of this can be protected and private fields introduced into the standard by ECMAScript, which has been around in TypeScript for some time. The difference is that TS is checking it at compilation, and ES during runtime — and this can affect application performance.

TypeScript won’t make your software bug free. But it can prevent a lot of type-related errors.

For example, when you have an object you now can’t misspell or accidently access a property that doesn’t exist.

Thanks to it, it is now way more difficult to write invalid code. If it compiles, you might be quite sure that it actually works.

TypeScript is a superset of JS, so all of the JS frameworks should be compatible with TS with a little bit of tweaking. that being said you might be terrified when hearing the word tweaking. fear not, practically every modern web framework supports typescript and even some of them enforce it as a the primary language.

Some examples are Angular, one of the most popular front end web frameworks, NestJs a robust backend framework that I personally like, etc …

Even React and Vuejs adapted and supported typescript, so what are you waiting for ?

Final Thoughts

Typescript is a very popular and useful tool that both frontend and backend web developers need to at least know the basics of it.

Writing articles is a tough thing to do so please support me by following and clapping also consider sharing the article and comment what should I write about next.

a full stack web & hybride mobile developer, specialized in the mern / mevn stack, a javascript. also has experience with react native and is learning flutter