5 ms·
I do find it rather strange that strongly typed code with no errors, that builds correctly, can fail at runtime due to type errors. My JS oftentimes ends up nic
by sli 7y ago
I do find it rather strange that strongly typed code with no errors, that builds correctly, can fail at runtime due to type errors. My JS oftentimes ends up nicer than my TS because I don't have pages of, basically, type-level administrative work.
I don't have this experience at all in other strongly typed languages, including very strong ones like Haskell/PureScript. The types there just work for me.
- cryptica 7y agoThis can happen if handling data from a remote client. Type checking does not happen at runtime so you still need to do your own schema validation even with TypeScript. So IMO it adds almost no value.
- jimmyspice 7y agoin which case your API layer should validate the data at runtime so that it only actually returns type T as it claims. then you are back to soundness