In May of 2017, I received a private message from Blogosphere asking if I was interested in writing a book about the front end. I had never thought of writing a book myself, and was only Posting a few posts on the blog garden, when I suddenly received the news, I was very upset and excited. With the intention of trying, I added the sender’s QQ and wechat and talked for several hours. I learned that to write a book about the front-end interview, published by China Machine Press, the main thing to do is to sort out the basic knowledge of the front-end, the biggest challenge is persistence. This is a long battle, the knowledge point combing can not be completed overnight, so I will lose a lot of rest time. Busy work during the day, but also have to burn the midnight oil at night, mental and physical stress will be under great.
Although we had to face so many difficulties, we finally took the job. One is to do something meaningful with your youth in order not to leave you regrets. Second, in order to consolidate their knowledge, although read a lot of books, participated in a lot of projects, but in many cases, can not learn to apply, some knowledge after reading, will not be used in the work, there is no appropriate record, slowly will be forgotten; Third, I want to share with you what I know. At present, various advanced front-end technologies emerge in an endless stream, dazzling, and basic knowledge has not been paid attention to, so I want to write a book like this, hoping that readers can quickly understand the various basic knowledge points through this book, and then check the gaps for themselves.
First, preliminary preparation
Front-end interview is inseparable from a variety of written questions, so the preliminary preparation is to collect the market known front-end questions. Through the written test website, personal blog, Github and other channels, I collected all kinds of domestic and foreign exercises, a total of about 3-4 thousand, each topic will involve one or more front-end knowledge points. These tips don’t cover all aspects of the front end; I’ve just picked the ones I’ll use in the book. Below is a list of topics from a foreign website.
After collecting so many questions, the next step is to classify them. Classification cannot be divided casually, it is to want to have basis, because this wants to refer to the authoritative technical data on a few market. Can beW3C Standards Document, or published books such as the definitive guide to CSS, the definitive Guide to JavaScript, and the Definitive Guide to HTML5 (as shown below). I ended up putting together a list of things that I was happy with, and this is actually the beginning of this book. The reason it’s called a prototype is because AS I write it, I’ve been tweaking it, merging it, separating it, picking out the key points, making it more targeted, and making it easier for the reader to understand. It took less than two weeks to collect the topics and classify them, and then the writing of the text began.
Ii. Writing process
1) Reference materials
In the writing process, mainly refer to books and standard documents. Books are more carefully worded, more clearly described, and more authoritative than individual blog posts. Standard documents, though more opaque, are official, so they are more accurate and have more technical terminology, as you can see below. When I am unable to understand or have doubts about the contents recorded in books and documents, I will browse online materials and make a final judgment based on these materials. Here is a joke about the online materials, a lot of copying, and lack of in-depth analysis, most of them just tell you how to do it, but don’t tell you how it works.
2) Carefully worded
One big difference between writing a book and a blog is the wording. Writing blog words can be more casual, think of what to write what; Writing a book is different. It’s printed on white paper. It’s a bit more serious. So use the most accurate words to describe what you want to convey. Every time I encounter this kind of situation, I will think about it, search for the meaning of the word, and then put it into the sentence, repeatedly experience, and finally decide which word to use. Although not as exquisite as literature, but in order to be more rigorous, the word is necessary. For example when writing met a “set” and “making”, two word pronunciation is the same, and the word is similar, a bit not careful will be mixed, the final check after the word meaning, to understand the difference between the two, “create” biased toward a final decision, make sure completely down, “set” favor from scratch to create, draw up and then concluded. “Formulate” is often used with policies, decrees, guidelines, routes, etc. “formulate” is often used with plans, programs, etc. For example, “of” and “ground”, “judgment” and “judgment”, they should be used differently, otherwise they will be mixed.
3) Technical terms
CSS, HTML, and JavaScript all contain a lot of jargon, and it’s the jargon that’s most easily overlooked. Because in the usual communication, we can’t think of or do not need to use professional terms to communicate, will use conventional spoken language to express. For example, the most common reference CSS styles can be divided into inline styles, inline styles and external styles, but we may not call them that. Inline styles can be called inline styles within tags, inline styles can be called inline styles within pages, and external styles can be called styles within CSS files. This is fine in casual conversation, but not in a book. If you use this colloquial title every time, it will inevitably seem unprofessional and redundant, making it difficult to keep up with each other. I didn’t pay much attention to these terms before, so I had to read several technical books at a time, as well as browse the relevant standard documents. Standard documents are the most authoritative, but they are all in English, and when translated from English to Chinese, there are many versions. Because each version is a little bit different, I make my choices carefully.
4) Be clear
In the past, when writing blog posts, IN order to implement their concise style, they will jump to write, not coherent, similar to taking notes. While convenient, this approach doesn’t translate to writing a book, because without a link between two paragraphs, it’s hard to understand. It’s written for the reader, and if the reader doesn’t understand it, it’s a failure. When writing a book, I always remind myself to stand in the perspective of the reader. To take a simple example, when explaining something, there is usually a piece of code. In the past, I wrote directly before or after the relevant content, and did not explain the code further. It’s easy to assume that the reader, after viewing the content, will know that the code is related to the content. This is a big mistake and should be avoided as it wastes time and deters the reading experience. Every time I want to describe a knowledge point or term (for example, the description of semantics), I will appear to be about to say but stop. I clearly know what this is, but I just can’t describe it accurately with words. This situation repeated, the book to use square hate less, this time really feel helpless to their vocabulary. Every time after reading a lot of information, to write their own satisfactory copy. Every time I finish a chapter, I feel like MY body is being emptied.
5) Grasp details
In addition to the four points just mentioned, there is another important point, that is to grasp the details. For example, the writing method in the book should be uniform, whether punctuation marks or the terms just mentioned, should be the same. If Chinese symbols are used, they will be used without special circumstances. If the style defined in the style attribute of an HTML element is called inline, it should be called inline everywhere. There are other details, such as the layout of the sample code, so that the comments of each statement can be aligned with the first letter to improve the reading experience; Set a number for each picture so that you can locate a picture more accurately when reading; End a paragraph with a full stop in the right place.
Third, summary
The process of writing a book was painful and happy. I spent more than half a year, devoting all my energy to writing the book and giving up a lot of spare time. Although the process of writing each article was difficult, I also learned a lot. My knowledge of HTML, CSS and JavaScript improved, and I also reviewed mathematics (such as coordinate axes, divisor and dividend, etc.) and network principles (such as HTTP, TCP and other protocols) and other peripheral knowledge. You can see things from a higher point of view. I am also more careful in my work. I have checked the whole book for six times in total, and I will treat each time seriously. I have organized a copy of the sample code in the book and uploaded itGithubIn the. I also summarized four mind maps (also uploaded to Github), which included HTML, CSS, JavaScript and web-related knowledge in the book into the maps for daily review and browsing. The book is calledFront-end programmer interview paper treasure book”, the cover is shown in the picture below.
Although I did my best, but the time is short, and their ability is limited, there will be mistakes, but also hope that everyone a lot of correction. This book focuses on the front end basics (as shown below), including CSS/CSS3, HTML/HTML5, and JavaScript (mainly ECMAScript 5), so some of the more advanced knowledge is not covered. React, VUE, TypeScript, etc., are not covered in this book. For example, more complex performance optimization, algorithms, etc., are not involved.