Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Is it possible to get by with regular js?Can. TypeScript only adds static typing to JavaScript in compile time. After compilation there will be all the same JS.
What will be the benefits?The main plus, IMHO, is the speed of development due to IDE hints and auto-completion, more auto-refactorings. Well, the ability to restrict the use of functions / methods from unwanted use is also a plus. And if you also design a domain model on types, then you can immediately see if something does not converge, even before writing logic.
Wouldn't there be a lot of extra writing compared to pure js?Most TypeScript types are able to infer. Far from Hindley-Milner, of course, but also good. I write more in the FP style, with a rare admixture of structural-procedural when describing effects, so I have explicit type indications only in function signatures. In the logic itself, the code is indistinguishable from regular JS, but with good type checking.
Will it be difficult to store compiled js?Like any other build artifacts, compiled JS does not need to be stored. Compile just before putting it into production, and in git store only TS code + compiler settings. And in the dev environment, you can generally run through the ts-node module.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question