Re:Ask HN: Should add typescript to my stack or Flow is enough?
by efi_mk on Friday September 21, 2018 @01:15PM
(#18041145)
Tx. Are there any clear benefits comparing it to es2016 + Flow ?
Re:Ask HN: Should add typescript to my stack or Flow is enough?
by jeremychone on Saturday September 22, 2018 @02:32PM
(#18047283)
I just looked at flow briefly, but for what I can see, TS is a much more advanced typing system, the tool support is amazing (VSCode for example), and most libs today are TypeScript typed one way or another. The later is probably the one as it add for most node libs, intellisense, hover / option-click to drill on the method signatures, and most of the time it will get you to the full lib API description. Productivity is through the roof with those alone.
However, TypeScript is a whole different game, as it is really a superset of JavaScript and let you almost all you can do in JS. The industry support is amazing, most of the major node lib comes with their TypeScript types (from the project itself or from @types/...), and the tooling support in VSCode for example is just amazing.
I looked at Flow a little, and while it seems less intrusive, I am not sure it is as expressive, powerful, and mature as TypeScript typing system.
The trick to realize is that it is not because you have "class", interface, and generics that you have to code JS the Java way. TypeScript does not change your style of writing JS, it just makes it more robust and scalable (with the number of developers & line of code).