3 ms·
> I'm fairly convinced (and I don't mean this in a condescending way) that the main group of devs that really likes TypeScript must have done mostly JavaScript
by nawgz 5y ago
> I'm fairly convinced (and I don't mean this in a condescending way) that the main group of devs that really likes TypeScript must have done mostly JavaScript and/or Python before
I don't think this is entirely wrong, it's exactly TypeScript's retained dynamic-ism that makes it familiar and "easier"; but in my case I've spent significant time writing Java, including production scheduling software, and I just fully disagree that TS is "weak as hell" and has "type-erased generics". Like I said, I find it in me to strictly type programs including the boundary-crossing data (GraphQL w/ codegen or io-ts are leaders in their respective paradigms) and including a library of generic components which correctly can give you access to any data T you passed through to implement content generators etc..
For example, there were complaints about Record<>, but I simply use the object syntax { [key: string]: number | string }, so I can't speak to your use case, but I don't really understand why Record would be used.
I suppose I agree immutability doesn't exist without explicit use of Object.freeze, but I can't believe I would hear someone say "shitty null handling" as a TS/JS complaint when they come from Java land. To reduce my implementations to "JSDoc" is pretty funny as well
For the example about generics, I suppose I'd have to understand why it was using `K extends keyof T` instead of `K in keyof T`, I would agree the "extends" keyword is horrible for generics but I also find it difficult to conceptualize why someone would care about the keys in the superset that aren't in the default set (i.e. K extends keyof T - K in keyof T seems like a useless set to me)
To conclude, I guess I would love to see you show me what you are using "advanced TypeScript features" for, because I write fairly complex dataflow / model / graph editors & capabilities, and go to lengths to provide the capabilities generically as a component library, and I've never found an issue providing type hints. Period. I of course haven't implemented everything ever though, and I do avoid doing too much in the world of union types, so maybe this is why