I
I
IkaR492019-06-14 22:43:08
typescript
IkaR49, 2019-06-14 22:43:08

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

5 answer(s)
O
OnYourLips, 2019-06-14
@OnYourLips

Depends on the specific application.
For example, in Angular applications (the third most popular modern framework), it completely replaced regular js.

N
NewDevLab, 2019-06-14
@NewDevLab

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.

A
Anton Shvets, 2019-06-14
@Xuxicheta

TypeScript was already there

it appeared not so long ago and became popular largely thanks to Angular
It looks like you don't know much about js.
It doesn't replace js, it makes js more understandable to the IDE, adds some sugar, and does type checking at the coding and compilation stage. Those. for the programmer, auto-completion and code type checking appear, which allows you to catch and understand simple errors immediately, without executing the script. To some extent, checking can be entrusted to linters, but one does not interfere with the other.
Looking for what. The more complex the project, the more often you have to swear on js.
But there is still no escape from js until no one is going to replace it.
If you're interested in a node, check out Nest.js or alternatively routing-controllers and other typestack solutions. They make the backend much more expressive than the usual express noodles.

A
Alex Karo, 2019-06-15
@Zraza

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...

R
Robur, 2019-06-15
@Robur

There will be a de facto standard in a few years (3-5). Regular Js, of course, will also remain, but it will be needed just as now you need the ability to write vanilla js. It seems to be there - but everyone moved to frameworks a long time ago and densely.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question