DEV Community

Discussion on: To Typescript Or Not To?

Collapse
 
stevepryde profile image
Steve Pryde

As someone who has worked in test automation for many years, this is for all the JavaScript Devs out there who want to argue against typescript. TL:DR you're just wrong. Sorry.

Does typescript hurt productivity?

If you're only measuring time until you launch your code over the fence, then sure. But what about the bugs in production?

What about the time taken by other teams or your customers who either have to debug what went wrong (obj is undefined / has no such method) or wait for your fix?
What about debugging time?

Typescript catches type bugs that would otherwise have gone to production.

Are JavaScript Devs more careful because they know they have to check types?

Sorry, but no. As a QA this defense is almost laughable. There may be some careful Devs out there (but still why check things manually when you can have the compiler do it for you?) But in my experience they are few. What is common are Devs who are over confident in their ability to write bug-free code.

Just use typescript. Seriously. You may think JavaScript is just as good at catching type bugs but if you honestly think that, then you need to have a chat with your QA team.