TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Should JavaScript newcomers bypass ES5?

1 点作者 bpesquet超过 8 年前
Hi,<p>I&#x27;m a CS teacher and the author of two entry-level JavaScript courses written in ES5. I&#x27;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&#x27;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&#x27;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.

2 条评论

hackmode超过 8 年前
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&#x27;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.
haack超过 8 年前
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:&#x2F;&#x2F;medium.com&#x2F;airbnb-engineering&#x2F;turbocharged-javascript-refactoring-with-codemods-b0cae8b326b9#.x49rply1r" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;airbnb-engineering&#x2F;turbocharged-javascrip...</a>