Answer the question
In order to leave comments, you need to log in
What is the future of TypeScript?
Hello.
A few years ago I became interested in learning JavaScript, not least because of Node.js
TypeScript was already there, but nothing was heard about it. However, now it is found everywhere, in articles on Habré I see it even more often than JavaScript.
I know it compiles to js and brings things like classes to the language. But what is its real value, what are the chances that it will completely replace regular js, how many products are already on it?
Answer the question
In order to leave comments, you need to log in
Depends on the specific application.
For example, in Angular applications (the third most popular modern framework), it completely replaced regular js.
Eventually (in a few years) TypeScript will be one of the many client-browser languages due to being compiled to wasm when wasm has a native DOM binding.
js must die. not that round of development of a spiral.
TypeScript was already there
From my point of view, typescript has certain advantages over pure js:
1) Type declarations play the role of documentation. You can forget about JS Doc. And, unlike documentation, it's harder to get a discrepancy.
2) Consequence from the first - typing in the IDE, auto-imports, better code navigation, easier refactoring.
3) Additional protection against errors in runtime
But there are also disadvantages:
1) More time spent on writing code (if we want everything to be described normally)
2) Higher entry threshold
3) Periodically you encounter the fact that type declarations in external libraries out of touch with reality
4) Functional libraries (lodash, ramda) are difficult to type with current TS capabilities. Although, it seems, there are improvements in this field - you need to look at the changelog.
Recent trends are developing in such a way that many projects are rewritten on TS or written on it right away: ant-design, mobx, appolo, loopback, vuejs 3 promise on TS
For backing, there is quite an adequate TypeORM for working with the database.
You can generate TS types from the GraphQL schema NestJS
has already been written about here.
The chance that it will replace JS is, in my opinion, small. It is unlikely that in the coming years the JS engine will be cut enough to allow types to coexist natively in it.
Judging by the statistics of The State Of JavaScript, the growth is stable and no one is going to quit this language https://2018.stateofjs.com/javascript-flavors/type...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question