DEV Community

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

Collapse
 
metruzanca profile image
Samuele Zanca

Hey Lucas, I read your original article one day when i was aggravated by typescript. And now while I'm not so on the fence about typescript. My coworker and I think that typescript on the frontend with react is a bad idea. Couple the big slowdown that typescript has, especially when writing connected components or other HOC. (we've actually cheated and decided to to //@ts-ignore and not write the HOC normally required for properly typed injected props for the connect HOC) The other big annoyance we've noticed, particularly when working with redux is that like you said typescript is poorly documented. Finding examples of how to properly write those connected components was a frustrating experience.

Whats your opinion on typescript with react? We don't think its ready or worth it atm.

On the backend with nodejs typescript seems to be a lot more beneficial when writing something more than a REST api. e.g. an application that holds state or brokers messages to websockets or other protocols. Whats your opinion on this backend?

Collapse
 
bettercodingacademy profile image
Better Coding Academy

I don't think the frontend/backend makes a difference here - to me it's all about developer productivity. In some instances I feel like the amount of time I'm spending (sometimes double or triple just to get a complex function typed well) is not worth the potential amount of time I might be saving (couple minutes of debugging with well-written tests, maybe).

At the end of the day, if it works well for you - great! Regardless, my message is just one of caution and proper evaluation, and not letting the hype get to you. :)