DEV Community

Discussion on: The reasons I don't use Typescript

anthonyjoeseph profile image
Anthony G • Edited on

I really like this article! I think it's clearly written and I love the focus on feelings and lived experience.

I'm not sure I have much to say that hasn't already been said, but I do want to try my hand at defending TS here. My angle is this - I don't think of TS as the latest fad, I think of it as the latest culmination of about a century of research into the lambda calculus (which predates Turing), the ML/Hindley-Milner family of type systems, Category Theory and Informatics.

The tldr is that types allow you to prove important and surprising things with mathematical certainty. The Elm language promises zero runtime exceptions. There's an operating system that has been mathematically proven to be secure. In fact with the calculus of constructions you can even certify mathematical proofs (which is, to me, completely magical) - here's a paper documenting a proof of the four-color theorem using Coq.

I (dubiously) claim that Typescript is so significant b/c it brings this research to the mainstream. It may not have dependent types, or native higher-kinded types (though you can still use HKTs), but it is a powerful type system. It's even influenced the design of Scala 3. The exciting thing, though, is its tremendous adoption rate - npm claims 50%.

I'm sure you're aware of the commonly stated benefits - referential transparency, fewer/no runtime errors, self-documentation, self-testing, consistency, etc. Those are some practical reasons to learn it, but I recommend it because, as Phil Wadler says, the lambda calculus is multiversal. If nothing else, TS is beautiful!

jfbrennan profile image
Jordan Brennan Author

I wouldn’t call my list of reasons feelings, more like first and second-hand observations.

Thanks for the good comment, lots of interesting details