6 ms·
I can't get behind the idea that a type system is either completely sound or completely useless. Surely preventing 99% of issues (or 90%, or 80%) is good? I'm
by ahuth 5y ago
I can't get behind the idea that a type system is either completely sound or completely useless.
Surely preventing 99% of issues (or 90%, or 80%) is good?
I'm also not aware of too many real-world instances of unsoundness in TS that has caused problems. Obviously I don't know your specific scenario, but it's possible there are ways to work with TS (instead of against it) to get a good level of type safety.
- ragnese 5y ago> I can't get behind the idea that a type system is either completely sound or completely useless. EDIT: I'm sorry. I thought you were someone else. [REDACTED]
- ahuth 5y agoCan you link to where we previously discussed TypeScript? I don't remember that, and can't find it anywhere in my comment history (looked back to 2019). Also, I didn't mean to misinterpret what you said. Sorry about that.
- ragnese 5y agoYikes. I'm so sorry. I mistook your username for another one. That was incredibly rude of me to react like that without at least double-checking. I had a long and frustrating back-and-forth with someone else some time ago where I pointed out what I believe to be several glaring issues with TS's type system (like the fact that `readonly` properties on object types don't actually guard against writes in most situations) and every one of my criticisms was met with the equivalent of "You're saying a type system has to be 100% perfect or it's completely useless". And even though it's the internet and I should know better, it just irritated the hell out of me. Again, I'm really sorry for jumping at you like that. I think I'm traumatized over arguing about TypeScript... lol
- ahuth 5y agoNo worries. I made an assumption about what you were saying that wasn't helpful, either. All good!
- jshen 5y ago> Surely preventing 99% of issues (or 90%, or 80%) is good? You can’t assume there aren’t other trade-offs that you have to factor in to the analysis.
- ahuth 5y agoYou're totally right. Different teams and situations require different tradeoffs. While TypeScript is great for the tradeoffs I deal with, there are certainly others where it's not. Good call out.
- rsrsrs86 5y agoI think the gradual typing is just too permissive... It's not the same feel you get with type inference. Not to say that a unsound type system is useless. If you're coming from dynamically typed languages it will certainly feel safer, but if you come from a more strict type system it still feels like just a linter. In my experience.
- NoahKAndrews 5y agoSure, Typescript is vastly better than JavaScript. Its unsoundness still really sucks though.