Is TypeScript good?
The Mere Exposure effect describes our tendency to develop preferences for things simply because we are familiar with them.
Perhaps you have a friend you didn’t like when you first met; you found it hard to be around them. But after being forced to spend time with them, for work or social reasons, you grew to like them. You can easily overlook the initial reasons you were irritated by them.
I have a friend like that. Maybe you know them? TypeScript. I really didn’t like it at first. Writing it felt slow and clunky, and I couldn’t see how it could benefit us as a team when 99% of the codebase was still JavaScript.
But I stuck with it, and kept plodding through, learning how to type our codebase. I’ve been working with it for over six months, and I’m growing to like it. I’m still unsure if TypeScript is preferable to JavaScript or just the exposure effect at play. Do I like it just because I’m familiar with it?
The part I like most is being able to “see what things are”. Now I get frustrated when I hover over a function or variable in VSCode, expecting it to tell me its types, and it can’t because it was imported from a JS file.
The part that makes me wary is how clever it makes me feel. TypeScript has major big brain energy. It tickles my brain in a way I’ve learned to be wary of because whenever I get too clever, I write code that is harder for others (or me, in 6 months) to read. There’s a real dopamine rush from successfully converting a gnarly JS file into a TS one, even though I’ve achieved basically nothing in reality. The product is doing the same thing.
So, my internal jury is still out on this one. I will proceed with caution.
Thanks for reading! If you'd like to share your thoughts you can leave a comment, send me an email, Tweet at me, or add an issue on GitHub.
Comments
The Comments system is powered by a third party service - Talkyard. Sometimes they don't load 😞. If you're having trouble leaving a comment you can send me an email.