6 ms·
Real big fan of TS, like anything though you just have to be disciplined when using it. Type absolutely everything and set the transpiler to the most aggressive
by bazza451 8y ago
Real big fan of TS, like anything though you just have to be disciplined when using it. Type absolutely everything and set the transpiler to the most aggressive checks possible... If you’re being lazy and putting : any everywhere and then complaining about how good it is...you’re doing it wrong
In our project I’ve found we make a lot less mistakes than with pure JS and there’s a lot less pointless type check unit tests due to the guarantee’s it gives us. io-ts (https://github.com/gcanti/io-ts https://github.com/gcanti/io-ts) around rest endpoints checking json input as well has been a godsend.
- adwhit 8y agoI always use it with > "compilerOptions": { "strict": true } But given the huge number of other options I worry that like GCC's '-Wall', that doesn't actually give you the strongest possible type checking. Anyone know about that? My aim with Typescript is to turn JS into OCaml.
- stefano 8y ago> My aim with Typescript is to turn JS into OCaml If that's the goal, why not use the real thing http://ocsigen.org/js_of_ocaml/ http://ocsigen.org/js_of_ocaml/ ?
- scottmf 8y agoSo... ReasonML?
- PinkMilkshake 8y agoYou might like https://bucklescript.github.io/ https://bucklescript.github.io/ Facebook use it in Messenger.
- michaelmcmillan 8y agoI share your view! Unfortunately, getting devs to write proper unit tests is – for whatever reason – difficult. Types just smuggle themselves in with the rest of the program (granted they only cover a subset of the bugs tests do).