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??).
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).
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
2) Type "npm i -g typescript"
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"
4) Open it with a code editor
5) Add this code:
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"
And this is the result:
You can also find my articles on my portfolio:?mariusatasiei.ro/blog