|
|
|
|
|
by eric_bullington
3723 days ago
|
|
TypeScript is fairly mature and conservative, whereas Flow has some reasonably innovative and bold (for JavaScript!) features. I'd say go with TypeScript if you're looking for a type system closer to C# or Java (including extensive OOP features), and go with Flow if you're looking for a type system closer to F# or Scala (including things like type inference and disjoint unions), although Flow supports ES6 classes, too. In my opinion, the Flow approach is a more natural fit for JavaScript. That's not to say that either project can actually achieve the coherence and completeness of any language designed to be statically-typed from the start, but those are kind of the the type system ideals that each project seems to lean toward. Also, Flow is fully integrated into the React ecosystem, since it's built by Facebook. TypeScript can work with React, too, but TypeScript also tries to give first-class support to many other frameworks. TypeScript is undoubtedly the more mature of the two projects (Flow is much newer), but I'm very happy that both exist since they're taking pretty difference approaches to the "JS problem". |
|
I also wouldn't say TypeScript strives to focus on OO features - we try to be a type system that works well for JavaScript programming as it exists, while paving the way for the future. We don't even use classes in the compiler!
Also like you mentioned, we try hard to work well with many other frameworks and I think that will show. Angular 2, Dojo, Ionic, RxJS, and others are even written in TypeScript and provide a pretty great experience.