3 ms·
Ask HN: Should add typescript to my stack or Flow is enough?
#javascript and #typescript users, doing my first steps in JS (after coming from Python). I still don't have a clear answer on whether I should add typescript to my stack ? Types are important for me, so why not settle for Flow ?
Problems that I see
1. Complicates tooling
2. Another language to learn
I intend to use NodeJS 8.1 (supported by AWS Lambda) which supports ES2016, is it good enough for enterprise grade projects?
Help appreciated
- jeremychone 8y agoI would recommend TypeScript. I was a "pure JS" for years and avoided the GWT, CoffeeScript, and Dart kind of languages. We even avoided Babel as the added value was not there for us). 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).
- efi_mk 8y agoTx. Are there any clear benefits comparing it to es2016 + Flow ?
- jeremychone 8y agoI 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.