TypeScript, oh TypeScript
I don’t like TypeScript. There you go, I said it, “I don’t like TypeScript”.
If you’re a diehard TypeScript lover, good for you. Luckily there are many more languages out there that one can use and just because I like JavaScript, and not TypeScript doesn’t mean you need to grab your pitchforks and torches.
There are many reasons TypeScript just doesn’t work for me:
- If I wanted a strongly typed language, I’d probably just use Go.
- If I want to protect my application from type defects, I’d use one of the many type-libraries out there that can be used with JavaScript at runtime, such as Zod, Superstruct, Joi or Yup.
- TypeScript’s type system feels like it’s been retrofitted into JavaScript, well, because it has.
- Type gymnastics can be an arse to deal with and offer nothing more than a headache - which is where JavaScript runtime type checking libraries really shine.
- I get than on large “enterprise” projects, having TypeScript can be useful because not all developers are made equal, but I’m not working on large “enterprise” projects these days.
- I get than on large “enterprise” projects, TypeScript can be useful, but I’d prefer runtime checking as well, which can do what TypeScript does, but better.
- The joy of JavaScript is that it’s not statically typed! It’s dynamic and flexible and that’s what I love about it. Otherwise, see #1 above.
Really, as a group of developers we should all just chill out and use the technology that we enjoy the most, notwithstanding the constraints we have. And most of all, the user is what counts, not what we develop in. If you’re in a job using tech you don’t like, guess what, go somewhere else. TypeScript is another language that lets people do shit, just like Ruby, Java, Python, C#, C, Rust and JavaScript. If TypeScript is your bag, great. But, just because I like and write JavaScript, doesn’t mean that I have to write TypeScript and that JavaScript is bad. JavaScript keeps getting better and better and it works great for me. JavaScript with Superstruct is f*cking awesome.