4 ms·
I inherited several Flow codebases, which is from the same guy/group as Reason at FB, and attempted to do the same goal of "bah explicit type annotations, let's
by stephen 7y ago
I inherited several Flow codebases, which is from the same guy/group as Reason at FB, and attempted to do the same goal of "bah explicit type annotations, let's infer everything".
This nearly ruined the codebases and we ended up converting them all to TS because:
A) tactically, flow's global inference sucked, so many things that devs thought were typed, were not. I get they're trying a do-over and using OCaml to solve that this time around, which I agree is fundamentally a better approach.
B) strategically, explicit type annotations (i.e. at method boundaries) is a _feature_ for dev readability and comprehension and not a burden to be avoided. I get that Flow/Reason _can_ add these type defs, but many new devs see posts like this, think "nice, less chars to type!", and now write a 100k LOC codebase with a pervasive lack of any type defs.
Tldr, I think TS's explicit types at boundaries is actually best practice for programming-in-the-large.
- toolslive 7y ago> explicit type annotations (i.e. at method boundaries) is a _feature_ for dev readability and comprehension and not a burden to be avoided The problem is not the type inference, but tooling. If your IDE can, when you're coding can 'show-type-at-point' and your online github style code review tool shows the type of any expression, argument, ... when you hover over it, you no longer have this problem.
- spoiler 7y agoA was a bug. Previously Flow when certain errors happened internally, Flow would "demote" a type into `any`, but that's been fixed for quite some time now.