Skip to content
loading...

re: A Simple Argument For Typescript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Though I think TypeScript is useful and adds a good layer of safety in your code, I don't think it should always be used. You have to weight the pr...
 

I think typescript should always be used. In build scripts, browser-side, serverside, or even code snippets.

Its also my opinion that most projects type definitions don't haveto be watertight. Only define the types one need when one need them, and dont overcomplicate things.

Typescript as language is only the type definition parts, the rest is just javascript. So the way i see it typescript is just forcing well-documented javascript.

 

I really like TS, but I still prefer vanilla JS for small R&D projects. Setting up TS infrastructure and fighting with types is waste of time if you just need to check a hypothesis and throw away the project when it's done.

 

If TypeScript were the standard for many years, I would definitely agree.

But if you have a whole codebase to migrate or a team that is not proficient with TypeScript, I'm not sure if that would be a good choice since it would cost a lot. That's why I think the pros and cons should be measured beforehand.

code of conduct - report abuse