|
|
|
|
|
by Merg
2491 days ago
|
|
As far as I don't like the "Angry Lisp Drunk Haskell" version of TS e.g. loads of `<` and '>' mixed with functional concepts from half of the Haskell, which makes understanding code harder than necessary. Typescript is one of the rare good things in javascript. You have to understands JS, because there is always gun pointed at your foot, waiting to blow you away.
Still TS makes this gun, a little bit harder to trigger. You cannot just write Java in it and cross your fingers. Typescript gives you pretty good docs most of the time for free. Only problem is when author of code used `any` type or `Angry Lisp` version of it. Interfaces, enums and field access and typedefs are godsend. In defense of TypeScript, your example looks like casting `void*` in C. Well typed `JSON.parse` would be pretty complicated and require runtime-machinery. Only thing I dislike about TS is lack of proper `optional` types. I know the '.?' operator is coming, but still. |
|
It’s very helpful for dealing with untrusted/uncontrolled data.