5 ms·
Recent updates in TypeScript have also made ADTs much better to use and make expressing business logic in a statically safe way. It's incredible how much mental
by gunshowmo 5y ago
Recent updates in TypeScript have also made ADTs much better to use and make expressing business logic in a statically safe way. It's incredible how much mental overhead that good typing systems (and good utilization of them) can save you when navigating complex code bases.
- dllthomas 5y agoYou still need to tag your own unions though, right?
- gunshowmo 5y agoYes, and since typing is only at compile time, it's also missing some of the extremely convenient pattern matching syntax that I love from Haskell, Rust, Scala, etc.... Despite some downside, I'm a huge fan overall though. I haven't tried ReasonML or ReScript, but compared to bare JS, TypeScript makes frontend programming a lot more enjoyable to me.
- cercatrova 5y agoI consider ReasonML and ReScript to be effectively dead since they split the community a few times now. I don't know anyone who's actually using either in production, except for their respective sponsors Meta and Bloomberg.
- bern4444 5y agoWhy is pattern matching not possible when types are removed after typescript is compiled?
- dllthomas 5y agoThat was my first interpretation as well, and I don't think there's actually any such technological limitation. But I think what was meant is that typescript's mostly committed to not changing runtime behavior of the JS that remains when you strip the types away, and while I we might disagree with that goal or with its application in this instance, I can at least see the flow of the reasoning and label it a matter of priorities.
- domlebo70 5y agoWhat are the recent changes?