4 ms·
What are your options though? Don't use third party code? Use third party code with no types along with your typed code? The unofficial types might have some pr
by seanwilson 9y ago
What are your options though? Don't use third party code? Use third party code with no types along with your typed code? The unofficial types might have some problems (which I've yet to be bitten with yet) but it's much better than nothing.
- fauigerzigerk 9y agoI'm not convinced it's necessarily better than nothing. Introducing this whole new layer of complexity, potential breakage and maintainance issues is a trade-off. It could go either way depending on many factors. Another option is to use a proper statically typed language where that is feasible. Choosing between TypeScript and Flow I would keep an eye on how each of these ecosystems deals with the issue of third party type declarations and versioning. And if one of these languages gains support by library authors so that we don't need third party types, that would be a strong argument in favor of that language for me.
- frou_dh 9y agoTo get the benefit of static typing in the browser, it seems more strategic to use something that's actually a meaningful departure from JS (Elm, Scala.js, PureScript, ...) rather than JS as viewed in a warped mirror. You don't want to be fighting to change the fundamental nature of something while being crammed in the trench with it.
- seanwilson 9y ago> I'm not convinced it's necessarily better than nothing. Introducing this whole new layer of complexity, potential breakage and maintainance issues is a trade-off. It could go either way depending on many factors. I'm not saying they're perfect but they're practical. I've used numerous libraries with TypeScript using third party typing now and haven't come across any major issues yet. If you can use a proper statically typed language with libraries then that would be preferable but is that a realistic option? Right now, TypeScript seems like a practical and realistic option to me. It's no competition for me if I have to pick between plain JavaScript + third party libraries vs TypeScript + third party libraries with maybe slight inaccuracies in their types. For the latter, it's not much difference to coping with library bugs.
- deleted 9y ago[deleted]