Hi,<p>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.<p>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.<p>So my question is: how one should learn JavaScript in 2016, with ES5 first and ES2015 after a while, or directly with ES2015?<p>Thanks in advance for your feedback.
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.
Agreed with your point about having to add a transpiler, the extra complexity may just push newcomers away.<p>For porting over your old code to ES6, perhaps have a look at <a href="https://medium.com/airbnb-engineering/turbocharged-javascript-refactoring-with-codemods-b0cae8b326b9#.x49rply1r" rel="nofollow">https://medium.com/airbnb-engineering/turbocharged-javascrip...</a>