from Hacker News

Ask HN: Should JavaScript newcomers bypass ES5?

by bpesquet on 10/11/16, 8:47 AM with 2 comments

Hi,

I'm a CS teacher and the author of two entry-level JavaScript courses written in ES5. I'm considering the creation of a book that would include the material in these courses. A more advanced chapter would cover (among other things) higher-order functions, modules and of course ES2015. This book would target JS newcomers, not experienced folks.

I'm tempted to revamp my courses and start directly with the ES2015 syntax instead of ES5, but I see drawbacks to this approach, mainly the need for a transpiler and the sheer volume of existing ES5 code my readers won't be familiar with.

So my question is: how one should learn JavaScript in 2016, with ES5 first and ES2015 after a while, or directly with ES2015?

Thanks in advance for your feedback.

  • by hackmode on 10/11/16, 8:59 AM

    One needs to be familiar with both syntax with a preference for ES6 to be successful. When I was first learning JavaScript, ES6 was on the cusp of becoming mainstream. I hated the fact that it seemed like I was learning two different languages at the same time. That's probably inevitable though. I eventually went through the burning process and am glad I did. I now code exclusively in ES6 and am never going back.
  • by haack on 10/11/16, 11:04 AM

    Agreed with your point about having to add a transpiler, the extra complexity may just push newcomers away.

    For porting over your old code to ES6, perhaps have a look at https://medium.com/airbnb-engineering/turbocharged-javascrip...