DEV Community

loading...

Discussion on: I used to think TypeScript is a waste of time. Now I changed my mind.

Collapse
olore profile image
Brian Olore

Fun read, thanks for sharing.

I'm by no means a TS lover, but I'd argue that you may be missing one of the biggest benefits, and that is working with other developers. TS provides an in-code contract for you to express how your code works in terms of parameters coming in and values returned by those functions.

I don't care how much JSDoc you have, when the rules are baked into the execution of the code, things are easier to understand, and less likely to result in a bug.

Collapse
bettercodingacademy profile image
Better Coding Academy Author

You're right! I brought up my thoughts in that on another comment under this post:

Tests are crucial for user-focused insurance, whereas documentation is crucial for developer-focused insurance.

So yes, absolutely, just like how tests are for improving UX, TypeScript is for improving DX. :)