4 ms·
I consider myself at best a mediocre JS developer, that wants to get better. I'm interested in TypeScript but worry it would hinder my ability to improve my kno
by jbigelow76 11y ago
I consider myself at best a mediocre JS developer, that wants to get better. I'm interested in TypeScript but worry it would hinder my ability to improve my knowledge of the core language. I want to know how ES6 improves the language, not how TypeScript's syntax of ES6 improves the language. I know I could use regular JS files with TS but if I don't want to do any transpilation that seems redundant.
Has anybody else felt that way and did you go forward with TS or stick with vanilla JS?
- chc 11y agoThe question to ask yourself is: Do I want static typing? If yes, then TypeScript is quite similar to plain JavaScript and introduces this feature you want. If no, then JavaScript should be sufficient.
- kylepdavis 11y agoI felt the same until I finally broke down and did it. Basically, if you want to use ES6 (or ES7) features and are targeting an environment that might not have native support (browsers) or inconsistent support (browsers, io.js, node.js) then you will inevitebly need or want a build step at some point. You could probably get by with some on-the-fly transpiling for a little bit but I would avoid that as a long-term solution except for maybe in tests. I highly recommend setting up a build step in any project for BabelJS to ES5, TypeScript to ES5, or my favorite, TypeScript to ES6 to BabelJS to ES5. Not only will you get awesome language features, you will also get some really great tooling in VS Code or Atom. Also, it's worth noting that all of these language features are pretty much all optional so you can ease into them.