Amy Blankenship
1 min readMay 30, 2023

--

The first place I worked that had TypeScript calculated the "TypeScript tax" to be about 30% (i.e. we spent approximately 30% of our time trying to make the compiler happy). Most of this time was spent with code that actually worked, but just violated something a generic hidden deep in the code wanted. And by the time you're spending 30% of your time on it, you'd be way better off writing tests instead. Unfortunately, we couldn't just decide to do that, because the TS types still were there, extracting their pound of flesh before the code could build (sadly, it could be committed in that state, and then it would break the build). It can be as much of a caltrop as a safety net.

I get how if you only see the kinds of toy projects students get that you would have your perspective, but on a large codebase with an architect who is really trying to do the right thing but doesn't _quite_ have the skills to make seamless types, it's very painful.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (2)