Kai-Fu Li teaches students how to learn programming well

Source: Internet
Author: User
First, ask you a question: what courses do you take at school?
The reason for this question is that I think the basic computer science courses in the school are very important. If the courses in your school are properly set, you should first focus on these basic courses. Many students are confused when they see basic theories. They do not know how to use these charts, symbols, or even hardware knowledge for future software development. Very useful. For example, multithreading mentioned in the operating system class is useful in system programming. For example, although you will not involve computer hardware in the future, the knowledge in computer architecture is useful for analyzing algorithm performance (speed, and so on. Computer languages and development tools can be compared to words, while computer science knowledge can be compared to ideas. Only thinking, no writing, no writing; however, the writing is smooth, and the thinking is empty, neither. The university stage is the age of laying a solid foundation and enriching thoughts.
To become a good programmer is not simply achieved by learning a few courses. I personally think that the elements for becoming a good programmer are:
1. Solid basic knowledge;
2. Strong problem solving skills;
3. Skills in programming and debugging;
4. Innovation capability;
5. Team Cooperation capability;
6. Continuous self-learning ability;
7. Curiosity
These abilities and qualities (or even habits) should be developed from the university stage and from the trivial aspects around them. For example, many Chinese university graduates lack programming and debugging experience. I learned the C language. In the project, as long as the program can be compiled, run, and the input and output meet the requirements, the problem will be solved. However, have you ever thought about how to write programs more refined, efficient, and high-quality? Are you sure you want to find out the cause of the problems in program debugging, or are you sure you don't want to explain the problem? In addition, many Chinese university graduates have superficial, mechanical, and no curiosity about their knowledge. For example, have you ever seen how an object is initialized in assembly code after it is compiled? How are the members of this object stored in the memory? When a member function is called, what additional actions does the compiler add to the assembly code? How is a virtual function called? These things are not detailed in programming languages or compilation principles. But are you curious to know? Finally, some Chinese students are hard to remember, failing to learn the fundamental principles of a certain algorithm technology, and failing to respond and innovate. For example, the question is how to connect the same layer nodes of a tree without extra memory. Many students have been able to answer the question of "wide traversal. However, as mentioned in the textbook, extended traversal requires additional data structures (queues ). So how can I leave no extra memory? Please note that the queue method is remembered in the textbook, but you just don't know why queue is used. If you have a deep understanding of the role of this queue, this problem is very easy.
Programming language is actually a very basic tool, but you must master it well. Learning a programming language is like learning to write, but people who can write may not write articles, and write articles without having been written. However, if you cannot write, you cannot write an article.
First, you should learn computer basics well before learning the C language. Many concepts are very important to C programmers. If you have encountered many problems before you start to learn C, or have already started to learn C, you should take a good look at the computer-based books.
If you have enough patience and perseverance, you should learn the compilation before learning the C language. This will give you a clear understanding of many delicate concepts, if you are not so patient (with all my respect, most people may not ). You can read the C language textbooks again, but you must read them again. I believe I will benefit a lot.
When I see some posts that I have asked, I obviously haven't thought about the problem carefully or read books carefully, because the syntax and logic errors in these posts are really incomprehensible. If your Chinese homework is full of incorrect words, the teacher will never let you go. Why not lay a solid foundation first? Some people complain that the teaching material is poor and the teacher level is poor. However, I learned C language in tc2. at that time, I could hardly find any other books except tan haoqiang's books. I don't plan to give any comments on Tan haoqiang's book. It's really not a good book, but if it's a good book, remember it, there should also be a considerable level. No matter what books you read, read them carefully and try to understand them in depth.

If you are proficient in solving all the exercises in a textbook, you should transfer it to learning algorithms, even though your C language is not proficient yet, many details are still unknown and many problems have not yet been encountered, but these problems will be solved in subsequent work and study.
In the past, there was a famous formula, probably: program = language + algorithm + data. I don't know whether to mention it now. You may need to add more content: project management, quality control, and code specifications ............. However, this formula has a considerable reference value. It is similar to writing articles. Languages are like words. algorithms are the ideas of articles, and data is the content of articles. Therefore, after a stage of literacy, you should try to express your thoughts.
After a piece of scattered algorithm learning and the concept of the word "algorithm", we should systematically learn the algorithm. This process is combined with data, you should take a look at the data structure and be familiar with it. Most of the algorithms mentioned here are implemented by computers. I recommend this book because it not only introduces algorithms for specific problems, it also explains in detail why such calculation is required, how to obtain this algorithm, and so on. It is of great help to improve the ability to think about problems.
If your energy and time permits, you should start to read and write a lot of code now. The two are equally important. Although this learning method is inefficient and boring, it should be noted that the ancient mode of education has trained qiangu Wenhao, the current Chinese education has developed ............ (Alas, we all know that I am the victim of Chinese Education in Primary and Secondary Schools ). Reading code is indeed a very hard task. I tried to read all the original Linux kernel code, but I only saw less than a tenth of it, and I understood it in half, but I still feel very helpful. As for writing a lot of code, the reason is simple: practical technology should be improved in practice. However, if you have learned the C language and data structure (and have learned well), you should not focus on those small programs. It is a waste of time, at this time, you should write a program of some scale with a certain degree of practicality. And began to understand some ideas of Software Engineering in this process. The first program to be written must be a hundred errors, modified a little bit, and debugged a little bit. As for writing code and talking about my own experience, I read tan haoqiang's book for the first time. When I saw the conditional branch, I was very excited and wanted to write something, so I read some help from TC2 and learned how to program graphics. I wrote a game with fruit and bet disks. Someone may have seen it in the game room, that is, what kind of apple oranges can be pressed. You can imagine that at that time, I still didn't know the array, and I didn't know the loop. So all this kind of things were done with Goto, and the worst program in history was actually running normally, later, I found that loops can be used, so I replaced the code and finally put the small lights in the array when I learned the array. When I learned the file, after the image is put into a binary file (originally a line and a dot), you cannot remember how many modifications have been made. In short, after the program can run, the length has changed from 2700 rows to 127 rows. Therefore, it is a little perseverance to learn programming well.
Finally, let's talk about whether to learn C first or C ++ first. This is a matter of opinion. My opinion is to learn C first.
Although I seldom use C, C language is indeed more basic. A C ++ expert should consider some problems (such as memory operation problems ), beginners of C language may have to understand something, or they may make mistakes. These are only to be mastered sooner or later, but because C ++ focuses on higher-level concepts, these problems may be ignored in the process of learning C ++, so some people use C ++ for a year or two, but some problems are not very clear. Another major reason is that C ++ is too good, and C ++ programmers may feel better than C programmers (they do have a reason ), therefore, after learning C ++, you may be interested in learning the content of C, which will lead to a great opportunity for improvement.
To become a good programmer (in fact, this is true for any industry), it is important to develop a research, curiosity, innovation, hands-on, cooperation, not satisfied with the duck filling, it is not satisfied with the passing of the exam, but is not satisfied with the appearance of a good habit. This is not an overnight course. Of course, if your school courses cannot satisfy you, friends on the Forum may be able to recommend some books or subjects to you.
Finally, you cannot only learn languages. Many college students believe that learning the latest computer language, technology, and standards is the best way to pave the way because many companies require these experiences when recruiting. Although these new technologies should be learned, it is more important to study basic computer courses. Because computer languages and development platforms are changing with each passing day, the basic courses are the same: data Structures, algorithms, compilation principles, computer components, and relational database principles. One student vividly compares these basic courses with internal skills on the "Kaifu student network" and compares new languages, technologies, and standards with external skills. It is impossible for a fashionable student to become a master without skill.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.