Front-end talk-how to make yourself a JavaScript master

As I grew up, my interests kept diverging, and they were all in seemingly unrelated fields. I like mathematics just as I like history. My goal is to become a multi-talented person-a polymath-who can be an excellent person in many fields. This proved to be an arduous task, and I was suddenly faced with the danger that everything works and everything is sparse.

I began to think about focusing on certain fields, so that even if I can't become a generalist like the Renaissance, I can at least be proficient in certain aspects. So how can I focus on a certain field while mastering the huge knowledge system required for software development?

The content of this post is based on my experience in the past 5 years, and outlines the techniques and resources that I have used to become a good JavaScript developer.

Most web developers today face the same problem: they have to be good at many different areas, from the database to the back-end architecture, to the front-end user interface, and use their CSS knowledge to modify the UI.

Reading book

In order to achieve proficiency, focus and effort are the first conditions. If you don’t devote yourself to work, you will end up with a little understanding. For example, by reading some blog posts, because the initial time investment is low, it looks simpler. But in the long run, this learning model will take more time than the process of focusing on the essence of learning. The solution to this problem is simple: read a book.

Books let us stand on the shoulders of civilization. The refined words allow our knowledge to be passed on from generation to generation. As for the question of how to become a web technology expert, you have to keep a certain distance from the web itself in the process of learning. Because the web itself is a mixed and scattered medium for learning, my first suggestion is to read books related to majors.

For JavaScript , start with the book "The Essence of the JavaScript Language" called the JavaScript Bible. Although this book is relatively old, it is very suitable for getting started. "The Definitive Guide to JavaScript " is also a must, although you might use it as a reference book. In addition, jQuery author John Resig's "JavaScript Ninja Forbidden Technique" is also not to be missed. If you are looking for good (free online) books, check out "JavaScriptAllongé", "You Don't Know JS" and "Eloquent JavaScript " (click here to see its annotated version). These can be purchased in the form of e-books or print editions. In addition, Mozilla's Developer Network also has a good "JavaScript Guide".

Learn, use and read the library

The next most important step is to understand the library. If books teach you how to understand language, the library teaches you how to express it. For libraries, you have two important things to do: use them and read their source code.

By using the library, I started to know: jQuery, Backbone, underscore and one of React, Angular, Ember. Of course, this does not mean that you have to use these libraries, but competent JavaScript developers should have at least experience with these libraries (for better or worse).

For improving JavaScript skills, the second important thing is to read the source code of these libraries. Among them, I particularly recommend the source code of Backbone and underscore, because their code is very beautifully written. By reading and understanding underscore, your functional programming skills will be improved. The other is that the library recommended to me by several other developers is mootools (I personally have no experience in using and reading mootools, just to convey information.)

理解上述列表里的其它库,如 React、Ember等,可能有点难,但值得付出努力。至少略读其它库的源代码,看看它们是如何组织基础代码并尽量发现一些模式。其它一些值得使用和阅读源代码的库还有 d3、highcharts 和 moment.js。

练习与问自己问题

成为优秀 JavaScript 开发者的下一步是做大量的实践。理论上,这些实践的重点不在 DOM,而是语言,所以确保有测试工具能在 node.js 上运行。在 node.js 上做大量小练习。通过不同的方式使用 JavaScript 的闭包、原型、array-extras (map, filter) 等。当你经过大量练习后,头脑里就会对 JavaScript 有基本的想法。

我朋友 Armagan 是一名杰出的 JavaScript 程序员兼老师,他在课堂里使用的课本 《JavaScript 设计模式》 也是值得一看的。

试着回答诸如:原型继承是如何工作的?闭包的定义是什么?this 关键字是如何改变的?如何使用 apply/bind/map/filter/call?收集一些 JavaScript 开发者常见问题并尝试用自己的语言解释它。用书面或口头的方式向别人解释这些概念,能极大地提高能力。在做实践的同时,尝试做“假设分析”。例如,“如果使用两次 bind,this将会代表什么?jQuery 是如何确保 this 关键字是引用 jQuery 对象,而不是全局对象?这个库如何完成某个特性?”这些都是值得思考的常见问题。

学习标准

下一步是学习更多关于 EcmaScript 标准。找到一份最新的 EcmaScript 标准并尝试阅读它。除了这些,也要尝试学习即将推出的 JavaScript 特性,如 ES 6 和 ES 7 新增的。最近有一些新特性如:promises、modules、generators、comprehensions和 again。可以通过专门的书来学习标准,如 Zakas 的( Understanding EcmaScript 6 )或 Dr. Axel Rauschmayer 的ES6 书 ( Exploring JS )。阅读标准是获取专业知识和发现语言新特性的主要来源。

使用 web 上的资源

我之前提到使用 web 获取 web 知识的危险性,所以最后的建议是具体如何在 web 中获取最好的资源。Hacker News 是一个很好的资源,然而如果时刻关注它的话,将会花费较多时间,因为信噪比较低(表示 JavaScript 文章比例较低)。取而代之的是,关注 JavaScriptWeekly 之类的每周文摘。随着时间的推移,你会看到哪些库或技术是备受关注的。在 Twitter,尝试去关注那些有影响力的 JavaScript 开发者。这里是 Tutsplus 列出的 33 个值得关注的 JavaScript 开发者。其它在 web 上的资源还包括一些博客,如 Toptal Blogs、Rebecca Murphey’s blog (如果你对这个博客的帖子感兴趣,也可以看看 A Baselinefor Front-End [JS] Developers: 2015)和 Nicholas Zakas’ blog。(如果你有其它好博客,请 Email 我,我会将它添加到该列表里。)

另一个重要资源是大会视频和教育视频。对于大会,JSConf 系列都是高质量的。对于教育视频,我强烈建议 Pluralsight,因为他们拥有经验丰富的开发者准备的高质量课程。(我与 Pluralsgiht 没有隶属关系)

浓缩版

1)从阅读书籍开始,因为书籍能为你提供精华信息。

2)学习主要的库,如 jQuery、underscore、Backbone,并阅读它们的源代码。

3)多实践并尝试用自己的话解释“继承”之类的常见 JavaScript 概念。对上述主题进行演讲和交流。

4)仔细阅读最新标准,并开始使用该语言的最新特性。

5)关注 web 资源,每周关注一次文摘或博客,或观看会议视频和视频教程。

总结

一直反复这些并完成大量项目,将会极大地提高你的 JavaScript 编程能力。只有努力不懈,才有希望在几年后成为一名专家。我觉得自己是一名优秀的 JavaScript 程序员,离专家仍有一大段路要走,有很多技术需要在我接下来的学习生涯中学到。另外,随时可以通过 [email protected]向我提出反馈和修正。

后语:

1)之前在朋友圈分享,人丑就要多读书。读书是一件很快乐的事情,可以让你经历过的问题沉淀下来。可以让你知道为什么会这样。可以让你把问题总结下来。

2)文中提到的小练习,小编的做法一般是如果要练某个技术,往往会想一个小产品,然后把你想学的技术都往这个产品上用。这样比单纯的写demo会好很多,既锻炼了产品感觉,又把技术练起来。

《前端观察》专注于网站前端设计与前端开发、纯粹的前端技术分享。更多前端文章请订阅本头条号,也可以关注微信订阅号qianduanguancha(长按可复制)


原文地址  http://toutiao.com/a6192742314210083074/

Guess you like

Origin blog.csdn.net/ZxxSteven/article/details/53946567