3 ms·
Here's my POV as someone who once was a big fan of TypeScript but had to learn how to live without it for a long time and is now having to jump back into TypeSc
by tmm84 5y ago
Here's my POV as someone who once was a big fan of TypeScript but had to learn how to live without it for a long time and is now having to jump back into TypeScript because of a project.
Extra fluff/annoying -> It only seems like it. On a sufficiently complex or wide codebase that is written in JavaScript there is going to be loads of ad-hoc types/return values. Having a compiler determine what is coming in/out helps a lot.
Dynamic type checking -> This makes it more important to make sure that any dynamic parts are contained and the results conform to something before coming back into the codebase.
As someone who feels comfortable writing plain JS coming back to TS feels hard. Things that just work in the plain JS docs for libs/frameworks don't when the auto generated types are used. An example: a lib I was using allowed almost any string but TS was only allowing strings found in the source code in thus destroying the dynamic nature shown in the docs. I could have fiddled with type signatures and overrides and the like to please TS but I ended up doing a thing that was way easier than that (at the same time having to document why). Situations like this are probably what comes to their minds.
The best way to push for TS would be show how problems/tickets could have been avoided if types had been used.