3 ms·
To build on this: I think it is also a large part of the reason why TypeScript is amazing and very useful in the real world.
by skinkestek 3y ago
To build on this:
I think it is also a large part of the reason why TypeScript is amazing and very useful in the real world.
- giraffe_lady 3y agoBecause you need a ridiculously complex type system to model JS's behavior and then in the end don't even get soundness for all your trouble? I know this comes across as really hostile but I just feel very burned by TS's promises and hype. You can work in it more confidently than JS I think but a lot of that is due to the tooling. In exchange you massively increase the required knowledge and mental modeling to keep track of what's going on and why. I used to be all about it but now after using it in a few big projects I've lost the enthusiasm. Someone on here once described it in an excellent way, saying it's great for working out "type puzzles," which smart engineers tend to experience as important and productive. But the actual practical benefits in "the real world" as you say I'm becoming less and less convinced of.
- amitport 3y agoA sorry, it's really not that complex. That's just a matter of opinion and depends on what you compare with. B You say you are less convinced of the "real world" benefit and actually specify the main one: "a lot of that is due to the tooling"... great tooling requires specific typing, this is a only a compile-time pass.
- giraffe_lady 3y agoYes obviously it's opinion and I was offering mine. It's more complex than other languages with similar benefits. Languages with type systems as sophisticated as TS give you MUCH stronger assurances for it. Languages with less sophisticated type systems give you much stronger assurances for it. People are bringing up ocaml in here for very good reason. It has a fairly limited and simple type system compared to TS yet is able to make strong assertions based on it. Rescript is an excellent example of how this could have been applied to JS. This is the core tradeoff of being a superset of JS, but as more time passes it's harder to see the other benefits of that. You need a compiler anyway.
- evilduck 3y ago> you massively increase the required knowledge and mental modeling to keep track of what's going on and why. Can you explain more about what additional knowledge and mental modeling you think is required for Typescript that you're exempted from knowing in Javascript? In my experience, Typescript only exposes the ugly realities of Javascript. Ignoring it doesn't eliminate it.
- merb 3y ago> Because you need a ridiculously complex type system to model JS's behavior and then in the end don't even get soundness for all your trouble? most type systems are not sound. Co-, Contra- or In-Variance is a extremly hard problem there are not many languages out there who offer complete soundness over all types. most problems of typescript happen because people use interfaces a lot, since they are type hints for javascript objects, however once you start with classes way more and use strict mode, stuff is way better than just using js.