edit: right -> write
edit: right -> write
Every project I've converted from JS to TS, no matter the size, even the small, only a few hundred LOC projects, has had at least one major "how the hell did this ever work" type bug that the type checking discovered immediately and would have prevented from happening in the first place.
So I don't really do even small projects without TS anymore. Anything more than can fit in my text editor, without scrolling, with the editor window tiled so I can see the app and the debug log at the same time.
I used server side JavaScript for a decade before Node existed, so I have lots of experience with this sort of thing.
And don’t even get me started on refactoring.
Any tool that prevent me from shooting myself in the foot, is appreciated.
Inherent in that is their teammates will not be able to go as fast as them.
For BE code it can take 10 minutes to hours to deploy with debug info, so type errors are a huge PITA and strong types are critical.
Ok, maybe a dev is much faster writing JS because they keep stuff in their head better. But I’m assuming they also use third party libs, or functions that other devs in their team have written that they just need to call.
Typescript makes it easy for the IDE to show you what exactly you need to pass to call the teammate’s function (and this was the originally motivation behind typescript…improving MS dev tooling) without having to dig into the code or read the documentation.
And type inference means you’re rarely actually writing out the types. So I find it hard to believe that anyone writing a relatively complicated piece of code would be faster using JS over TS.
Small scripts and the like, sure. But complete complex applications? I doubt it.