GIVE TYPESCRIPT A CHANCE

GIVE TYPESCRIPT A CHANCE

TypeScript is a "programming language" which offers you all JavaScript benefits and some more addons.

A few things that TypeScript is improving through these addons are:

- level of maturity/safety

- maintainability aspect

- code hygiene

- code readability


I heard a lot of myths about TypeScript. Most of them were "must have" myths, like, "You should have at least 3 years experience with JavaScript to start learning TypeScript" and some of them were bad comments, like "You will mess the apps, the JavaScript libraries don't support TypeScript". 


As a student with 0 real world experience, I got scared by TypeScript. I was seeing it as a programmers' Michael Myers, alongside with Algorithms and Data Structure in Java(this one still remains😬).

No alt text provided for this image

But one day, when I felt less sceptical, I gave it a try. Now, I have over 6 months of using it and I can't confirm any of the bad myths about TypeScript. It just improved my efficiency and never felt that I want to go back. Almost, all my portfolio apps are built in TypeScript with the MERN Stack(Mongo, Express, React, Node).

No alt text provided for this image

Bloomberg, a software company, recently faced a big challenge, by moving all engineers from JavaScript's guild to TypeScript and now, all of them, even the most sceptical ones, find it as an improvement.


If an entire company did this big change, then you should give it a try, too and to settle down if the myths are true or not. 


Installing it is not a big deal, so if you want to try it, follow the next steps:

// I'm assuming that you have node and npm installed and updated.


1) Open a terminal

No alt text provided for this image

2) Type "npm i -g typescript"

No alt text provided for this image

2.1) If you want to run the app from terminal install ts-node with "npm i -g ts-node"

3) Create a file named "greeting.ts"

No alt text provided for this image

4) Open it with a code editor

No alt text provided for this image

5) Add this code:

No alt text provided for this image

6) Run the code. If you are using VSCode, you can run it by clicking Run Code button(its default shortcut is Ctrl + Alt + N) or by using terminal, type "node greeting.ts"

No alt text provided for this image

And this is the result:

No alt text provided for this image


You can also find my articles on my portfolio: mariusatasiei.ro/blog

To view or add a comment, sign in

Others also viewed

Explore topics