Re:How porting to TypeScript solved our API woes
by Fellshard on Wednesday April 08, 2020 @09:43PM
(#22819066)
However, in JavaScript-world, where the external types you interact with - from other libraries, from APIs, from the browser itself - are poorly defined, having that escape hatch becomes a sanity-saver, does it not? That's where the power comes from: the squishy, fuzzy, less structured edges.
[ Parent
| on HN ]
Re:How porting to TypeScript solved our API woes
by dpc_pw on Wednesday April 08, 2020 @10:25PM
(#22819250)
The parent-parent comment was "I want an escape hatch in the language" and then the argument for it is "someone else used an escape hatch, and now I need an escape hatch". :D
Re:How porting to TypeScript solved our API woes
by RobertKerans on Thursday April 09, 2020 @12:44PM
(#22824415)
Well, yes, most of the packages available in the JS ecosystem were written in JS. The easiest way to retroactively write typings is to use `any` all over the place.
Re:How porting to TypeScript solved our API woes
by yakshaving_jgt on Thursday April 09, 2020 @07:38AM
(#22821567)
> having that escape hatch becomes a sanity-saver, does it not?
No, it does not. There is no difference between static languages and dynamic languages when parsing data at runtime.