News for hackers. Stuff that matters.
Re:TypeScript at Slack by vanwalj on Wednesday April 12, 2017 @03:50AM (#14095644)
Having experience with both on Node back-end projects, I can tell you than IMHO Flow is smarter, especially on union types, BUT there are way more TS community type definitions available right now.
Re:TypeScript at Slack by johnfn on Wednesday April 12, 2017 @04:01AM (#14095679)
I'd be curious in which ways flow is more intelligent than TS.
Re:TypeScript at Slack by vanwalj on Wednesday April 12, 2017 @07:11AM (#14096547)
Here are some examples: TS: https://www.typescriptlang.org/play/#src=type%20TA%20%3D%20%... Flow: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgCSAgmA...

With Typescript, you have to write custom Type Guards functions, whereas Flow is smart enough to infer type

Re:TypeScript at Slack by johnfn on Wednesday April 12, 2017 @08:40AM (#14097035)
If you use discriminated union types - e.g. give them both a type key which is a unique string, then you don't need type guards as typescript is smart enough to understand that checking the type key does the type discrimination.
Re:TypeScript at Slack by vanwalj on Wednesday April 12, 2017 @01:57PM (#14100057)
Sure, but you don't always have control over an external module or service, and it still something flow is better at
Re:TypeScript at Slack by johnfn on Wednesday April 12, 2017 @10:08PM (#14103547)
Yeah, that's true. I don't know why you've been downvoted. You have a legitimate answer.
Re:TypeScript at Slack by boubiyeah on Wednesday April 12, 2017 @04:20AM (#14095781)
Me too. I don't really see how you can get any smarter with union types than with TS 2.2+