Week 8 Reading Notes - The Beauty of Programming

 

This week, with the introduction of classmate Chen Can, I also started to read the book The Beauty of Programming. I haven't read much, and I'm still stuck on the first chapter. Although this book has only four chapters in its entirety, it is not a thin book of "Luoyang paper is expensive". On the contrary, in the few pages I read, the knowledge and insights contained are not small.

The book's preface begins with an interesting example, which is the focus of my post-reading review. This example is about an interview with Microsoft, and the girl who was interviewed was given such a topic: "Please write a program to keep the CPU share in a straight line of 50%". Faced with such a "wonderful" question, a girl is of course completely clueless. Even if the interviewer (Mr. Zou Xin) lends her a notebook and asks her to check the information online, she can't do it within 45 minutes. Maybe she A topic never seen before. By the end of the interview, the girl was very frustrated, and the interviewer also felt regret, because because of this problem, he also missed the opportunity to learn about other aspects of the interviewer.

There is no doubt that, from the perspective of Chinese students, such a strange question can be said to be unlucky. Not only because the class does not cover this type of topic, but also because I have never re-examined "programming" from such a perspective. If there is no clue, then it is likely that this interview is over. However, if we put aside the utilitarian nature of the interview for a moment and just measure the question itself, it is actually a very interesting programming question. The interesting thing is that it not only examines the coding ability of the question maker, but also examines whether the author has a deeper understanding of programming. Programming is by no means limited to textbook topics or a specific algorithm, but is closely related to the entire computer. Different levels of understanding of computer systems largely determine the upper limit of your programming ideas.

To be honest, when I saw this topic, I also looked at the examiner with a bewildered face, and then I had no idea at all, and maybe even the source code written by the girl (see picture) could not be written.

 

Indeed, this problem is essentially the same as the problem we usually practice, but the problem is turned into a task closely related to the computer system for me to solve. But I'm completely out of ideas, which shows that I have almost no understanding of the background of the problem. From this point of view, I seem to have learned the operating system and the principles of microcomputers in vain, because I have absolutely no thinking to think about problems from the computer system. I figured that if I were actually interviewing for this type of question, then the mismatch between my understanding of programming and my understanding of computer systems would be revealed in an instant.

Why can't I build this mindset? I think this is a very important answer I need from this book. I have always felt that my understanding of computers is not deep enough. Even if I have studied operating systems and the principles of compilation, I still have a feeling of powerlessness in computer science. This may be because my understanding of each course is isolated and separated from each other, which makes me lack a real high-level idea, an overview idea to approach each course from the whole. As Mr. Zou Xin walked me through the answers step by step, I discovered that, in fact, I have heard or seen all the specific knowledge of each step, especially the low-level knowledge of the computer (such as the calculation of instruction execution time) in the classroom. However, what I don't have is the knowledge and thinking needed to gradually deepen from the surface of the problem. This kind of thinking just reflects my excessive "black box" thinking - I regard the computer as a black box of input and output, but I never thought about finding a way to take this black box apart and take a good look.

Looking back, the beauty of programming that Mr. Zou Xin said lies not only in a certain algorithm, not only in the answer to a certain question, but in a kind of thought, just like the ball quotient in ball sports, which lies in a a process of exploration. Indeed, if I can get a better understanding of how this "black box" works, then more beautiful, concise, and more performant code will naturally be born.

To this end, I need to continue to work hard, learn more and read more, eat less snacks and sleep more, accumulate a little bit every day, and I can become a pillar in the future.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324935690&siteId=291194637