4 ms·
I can't speak for either project, but personally I would say that I don't think static typing in JS is a solved problem, and at this stage to me it seems a mono
by mambodog 10y ago
I can't speak for either project, but personally I would say that I don't think static typing in JS is a solved problem, and at this stage to me it seems a monoculture would be much less fruitful than a competition of ideas.
- bcherny 10y agoI would agree if they were at all different, but they seem to be syntactically and functionally identical. As a caveat, I am a daily TS user, and have only played around with Flow.
- pluma 10y agoI am not a computer scientist, but I have heard people repeatedly argue that Flow sets out to create a "sound type system" which TS intentionally does not. What this means in practice I don't fully understand but it seems to result in enough architectural differences that it apparently makes sense to have both despite the superficial similarities in syntax and behaviour.
- mlsarecmg 10y agoI think the issue is that TS is non-modular and dictates javascripts reach. It behaves like no other tool and blocks others from working. Take something like React/Redux for instance, which are built around modern day javascript, but if you transpile any example on the official Redux page right now you will see TS bail out because it can't understand some of the syntax. Flow on the other hand solves one problem and solves it well. It behaves as any other tool would.
- bcherny 10y agoNot sure I understand. Can you give a concrete example?
- mlsarecmg 10y agoYou can only do as much as TS allows you to, unless you route through babel in a second pass. TS is a tool that controls to which extend you can use language features that are drafted. They do pick drafts here and there, but others they omitt, object spread for instance which is very common for Redux. As i said, try to transpile this in TS: http://redux.js.org/docs/basics/ExampleTodoList.html http://redux.js.org/docs/basics/ExampleTodoList.html This is why they made Flow.
- bcherny 10y agoStill not sure I understand. All the code in that link is valid TS - TS is just a superset of JS. Object spread is not part of the ES7 spec. It is a proposal which has not made it to stage 3 yet, and might still be dropped. That said, there is a TS issue tracking adding support for it: https://github.com/Microsoft/TypeScript/issues/2103 https://github.com/Microsoft/TypeScript/issues/2103.