Home >Web Front-end >JS Tutorial >Summary of the Road to Efficient Learning of JavaScript

Summary of the Road to Efficient Learning of JavaScript

巴扎黑
巴扎黑Original
2017-08-04 13:31:091465browse

1. First, I will install the Chrome browser and practice directly in the dev tools => console to become familiar with basic syntax, variables, data types, mathematical operations, and characters. String operations, conditions, basic loop structures, simple function definitions and calls, etc. The reason why I use chrome dev tools is because I don’t want to bother with a separate editor at this time, nor do I need to open files and folders, and then configure some The tools finally come into contact with real JS programming. I want to start writing JS as directly as possible with as little interference as possible. This is the most important thing. I learn JS, and of course I should write JS as soon as possible

2. Familiar with the basic syntax In the future, I will compile a few slightly challenging small programs in devtools => console, such as implementing a simple fibonaci sequence, such as printing a 99 multiplication table. You can also give yourself a few questions, or Randomly find interesting topics on the Internet. Whether others have written about them or not is not the point. The point is to find something to do and let yourself write code. Don't underestimate these boring-looking programs. Once you have reached the level of proficiency, you can start the first one. Before the project, these small programs that are not available are the most suitable for practicing, because they do not involve other aspects of knowledge (such as DOM), so you will not be disturbed too much. You only need to focus on writing the correct program with correct syntax. This The process will make you more familiar with the JS language itself.

3. I think you can learn to use JS for web development at about the same time, but don’t worry, I’m not ready to create a new project at this time, so I will still be in devtools, but the focus is Familiar with DOM, I will start with simple window.alert, window.prompt, and slowly experiment with how to use the DOM API. I will buy a book on DOM programming, put it on my desk, and read chapter by chapter. While watching and trying, I gradually came into contact with the common operations of DOM, such as document.getElementById, document.getElementsByClassName, addEventListner, etc. These calls contain very important concepts, such as what is ID, what is Class, what is Event , what are they used for, and how does the JS language interact with them through APIs. I will select several website pages and make some modifications to the elements of the page, such as using JS to change the font and background color of the elements, or temporarily add event listening, etc. You can directly see the effects of the behavior of the DOM API on the web page. It is very intuitive and interesting. It is more vivid than writing pure JS programs before and can stimulate the curiosity of learning. DOM is the core knowledge of JS programmers.

4. Usually after reading a book on DOM programming, you have a general understanding of the use of JS in web programming. At this time, I will choose a project for myself, such as a message board, and use HTML5 Boilerplate as a template to start the development of the first web front-end project. Data can be stored directly in IndexDB, so there is no need to worry about background operations at this time. I will roughly consider what functions I want to do, and then use the knowledge I learned before about JS and DOM operations to implement these functions well. This project is going to take a lot of my time, so I tell myself to be patient. When I encounter a question, I will use a search engine to find the answer, or go to the book to find the corresponding chapter.

5. After writing the first project, I will feel a sense of accomplishment for the first time, even though the project is small and not complicated. I will find a teacher to review it for me and listen to his opinions and suggestions. I can also prepare some questions and ask him to help me see how to iterate next. At this time, I will learn the basic operations of git and the basic use of github, then push the project and commit the required changes to git.

6. Before this, I wrote all native JS, without using libraries or frameworks. The advantage of this is that I don’t need to get entangled with the concepts of libraries and frameworks prematurely, because now What is really important is the JS language itself. In fact, my programming field has been greatly expanded compared to the beginning. You see, I have used JS and DOM to write some very practical functions and completed a front-end project.

7. At this time, I have more choices. I can: continue to use native JS to complete one or two similar projects, such as registration and login, dynamic picture display, etc.; I can also: try to improve the program of the current project. Design and make some code improvements. At this time, you can read books like JS patterns, because the code structure of the first project usually does not have special programming, but the structure. Such books can tell you that better JS programs can How? I can also take advantage of the opportunity to restructure the project I am working on into jQuery-based code, so that I can learn the basics of jQuery and understand the benefits of jQuery through comparison; I can even restructure the current project code into ES6 syntax, so that it can be used in Benefits of ES6 syntax in comparison.

8. Next, I will write more complex projects, such as TODOLIST, and implement such an application from beginning to end. I will also write the first version in native JS (ES5), and then choose whether to refactor to jQuery. Or ES6, or even TypeScript if interested. If you continue to read books on JS programming, your attention should be on the "design" of the program, not on the grammatical details. Most of the time, grammatical issues can be searched. Program "design" is to analyze the needs of the application, what functions, whether it needs to be divided into modules, whether the modules are easy to divide, how to gradually find the architectural solution, what kind of modularization is more natural, how to deal with errors, whether Template support is required, whether complex use cases should be implemented by oneself or integrated with third-party libraries, and other issues that are far away from actual development.

9. I will still put this project into github. After writing it, I will find a teacher (free or paid does not matter) to review my implementation and let him point out the mistakes in my understanding. This is valuable learning opportunities. Just like the first project, I will still decide whether to continue iterating and how to continue to improve based on the teacher's feedback and my own thinking. By this time, I may buy and read all the must-read Javascript books on the market. Reading the first book is very slow, and the second book is not fast, but when I read the fourth or fifth book, I can read it very quickly. , select the chapters that you don’t understand and read them specifically, and then apply the knowledge, skills, and practices mentioned in the book to the projects you have written before.

10 I now have a relatively comprehensive foundation in JS (ES5) and am relatively proficient. At least when I encounter a problem, I roughly know what the direction is. I've also been exposed to jQuery, maybe even familiar with it; so is ES6. I have a relatively comprehensive and profound image of the basic ecology of language. Now I want to learn a framework. I will do some homework to see which framework I like. After choosing it, I will first complete the official tutorial and understand some basic conceptual issues.

11. Then what I did was to rewrite the previous project (such as TODOLIST) using the framework. At this time, I would no longer feel that it was very profound, because I had JS. Basically, I already have some experience in finding answers and debugging on my own. Even if the framework itself is unclear, I can find the answer by myself through searching or research. Even if I can't find it, I at least have basic development thinking. Although I don't know the answer, I still have a general direction. If I want to ask others questions, I can also ask questions that are more valuable to answer. I have become a professional. The path to development is not because I know this and that of the framework, but because I have the basic habits and qualities to do development.

12. Maybe I found my first front-end job at this time. After a while, I found myself interested in node backend development and electron. After reading the basic documents, I found that it was not necessary. How to learn how to use these things. Because I am already familiar with the architecture, common structures, patterns, and main concepts of JS programs, so as long as it is in the JS ecosystem, no matter what new technology is released, whether it is a library, framework, or pattern, I can be the first to do so. It takes time to find a way to understand them. I have learned how to learn, what are the important things in JS programs, and how concepts are combined and changed. So for me, there is no difference between learning JS and using JS.

13. Then, usually those who really learn it step by step and have a solid language foundation no longer need anyone to teach them.

I think there are some concepts and operations that are contrary to step-by-step.

1. Pursuing "systematic" learning too early is too high-minded. It is easy to be too ambitious and low-handed. People's energy is limited. You must respect the rules of learning, admit that you are an ordinary person, and warn yourself not to be tricky or greedy. , take your time

2. I feel that reading source code is the most "essential" learning, but as a result, I fall into the pit of details and cannot extricate myself

3. I immerse myself in the "latest" technology too early, For example, if you learn frameworks before you have a good language foundation, you will get half the result with half the effort. "The latest" technology and core technology are often not the same thing. With the foundation and core, learning new technologies is the most efficient, but the reverse is not true

4. We equate learning programming with reading books and accumulating "knowledge", but programming is ultimately a skill. You can't learn anything if you don't do it. What you "know" and what you "can" are two different things.

5. Trying to find the "best" learning path from the beginning without learning specific things is probably the biggest waste. The meaningful goal is to tell yourself what you will do tomorrow, rather than assuming what you "should" learn tomorrow

6. Excessive accumulation of learning materials, thinking that the more information you find and the more complete the list, the faster you will learn and the better. In fact, it is exactly the opposite. The more you list, the greater the noise and the stronger the psychological pressure and frustration. The easier it is to give up, at one stage, a book and a small amount of online information are enough. "Collecting" is a bad habit. Learners should pursue the digestion of knowledge instead of piling up

The above is the detailed content of Summary of the Road to Efficient Learning of JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn