Read Liu Weipeng "How you should learn C + + (and programming)"

Source: Internet
Author: User
Tags win32

tags (space delimited): provinces

Original address: How you should learn C + + (and programming)

I reflect on my own years in school to learn the half-watered. See this article, feel a lot of harvest. As if there is a sense of their own road, of course, the real difficulty is to persist in learning, more hands-on practice.
But this article does give the guidance meaning to the tangled knowledge detail or the abstract theory. At MIT's Introductory course on computer science and programming, Eric Grimson begins by saying that this lesson teaches not only how to program a computer to do something, but how to think about it in the face of problems, how to describe it in algorithmic or machine language, and then let the computer solve the problem for us. The following is the original text.

This course was going to being not just about teaching what to program a computer and how to tell the computer instructions th At it can understand. It's also going to being really important to create within you a capability to think computationally. So we goal are to let you become skillful at not only getting the computer to does something, but to does that thing this you Want it to, to get it to solve a problem. By the end of this course, we hope so your first instinct when faced with any interesting challenge are to first think AB Out how to could I capture that challenge, which problem in a algorithmic or mechanical description of steps such that I Coul D get the computer to does the work for me. If You can do this, it's going to give you a great deal of advantage as you face any kind of problem. And those is the skills that you ' re going to see throughout this course.

Here is the original excerpt and your own understanding:

1. While many of the details in C + + are in the hands of the library designer, there is no need for ordinary programmers to pay much attention, especially with no real motivation. General coding practice guidelines, as well as basic programming skills and basic skills, and even fundamental programming theory and algorithmic design. Is what really takes time to master.

A few books in the link,
1. "Code Encyclopedia": Cloud-Wind Blog "code Daquan" Reading notes
2. Csapp "In-depth understanding of computer systems"
This is the textbook of the "Introduction to Computer Science" at CMU. is an introduction to computer systems and operating systems.
3. SICP "Construction and interpretation of computer programs"
This is the textbook for MIT's 6.001 course. is an introduction to programming languages. (This class was changed to Python a few years ago.)
4. CLRS "Introduction to Algorithms"
This is the textbook for MIT's 6.006 course. is an introduction to algorithmic analysis.
The following three books are discussed.

2. Avoid any language details, unless necessary. This is necessary to refer to the actual programming problems encountered, so even if the need to ask details, but also the most convenient, lazy principle. A programmer who has mastered the basic programming concept and has a strong ability to learn is programmed in a strange language, even if the Bible with that language is flipped from the index. Ten years to learn programming does not mean that every language has ten years, that one life can learn a few languages, if in alphabetical order to learn the word in a lifetime do not expect to learn Ruby; Ten years of learning programming is not the first language characteristics from coarse to fine all thoroughly understand to dare to start programming, in practice, the most important to improve.

My understanding: The language details are also important, not familiar with a language but also have to master the principles of the very thorough, otherwise really used up, it is likely not to know what details to use. For the details of the don't understand, you do not know which is useful, which is useless, can not help. Turned over, how can the principle of a thorough mastery of it? It is often the beginning of a language to learn. For the average person, it is difficult to understand abstraction without going into specifics. All often the first language is more difficult to learn, then it will be much easier.

3. However, the real programming ability is not related to the language details, skilled use of a language can help you to best express your intentions, but the proficiency of a language does not mean that the edge of its corners are all remembered. Know some common sense, with the basic intuition of programming, encounter some details when the wrong time to check the book, is the most time-saving method.

4. C + + 's book, Bjarne's Bible "the C + + programming Language" is strategically advantageous position. "Large-scale C + + program Design" is very pragmatic. "Accelerated C + +" is the best introduction. "C + + Templates" is for reference only. "C + + Template metaprogramming" is the energy surplus can play a play, ordinary programmers touch not touch. The ISO. IEC C + + standard 14882 is not read. Bjarne recently in C + + education, the new book is absolutely can be expected.

5. P.s. On how to learn programming, G9 Blog has many wonderful articles: here, here, here, here ... In fact, I suggest you go and turn G9 's blog upside down:P

G9 boss, his blog

6. In fact, the right attitude is that the details are necessary. But the details are secondary. In fact, learning programming I think should be the first to learn how to express ideas with pseudo-code, you do not see "Introduction to Algorithm" inside the code? The code in "TAOCP"? Oh, yes. They are the language of their own creation, but the purpose of this teaching-only language is to avoid writing programs in the first place to forget to write the program to complete the function, thinking that the writing program is to combat the language details. Bjarne says the correctness of the program is the most important, and the boost coding standard also lists the correctness in front of performance.

7. What is important is not your mastery of the language, but your ability to master, borrowing Myan eldest words, "the important thing is this process, rather than the result, is your stout legs, rather than the bag of salt on your back." ”。 In addition to learning the meaning of C + + is really a continued rejection, such as the C + + system-level language, in the course of learning must involve some of the underlying knowledge, such as memory management, compile connection system, assembly language, hardware architecture and so on knowledge (note, this does not include excessive nook and cranny of the language). These things are the so-called internal strength (in fact, the most important internal skills or long-term learning honed out of self-study ability). The abstract law of the loophole mentioned in Joel on software is very beautiful to this big mouth Joel.

My understanding: This ability should be the understanding of the nature of programming. The so-called mountain is Mountain, see Mountain is not mountain bar. I used to see a thing, know where it can be used, and start a bit of rote memorization. Later understand what this is, why it needs to be, what the situation and it is actually the same, with the analogy association. But now, regardless of their internal strength drilling are too bad, all need kung Fu.

8. To make you a master is not what language you master, proficient in C + + may not be able to make you a master, not proficient in C + + may not be able to make you a low hand. I don't think anyone's going to suspect G9. If you want to copy a C + + to do a project, it will be better than most people who think they are proficient in C + +. So the key is not the surface of the language of things, but the underlying contradictions. Of course, not to say that any language do not learn, according to a kind of logic, "the world language, only imperative and declarative ears." C + + is the most complex of the former, supporting the widest range of programming paradigms. Borrowing from a teacher at the entrance to the mathematics department, "You have learned everything in mathematics, what can you not learn?" ”。 Learning language is a way, if you use it to hone yourself, can. If you use it as the key to learning the underlying knowledge of the system, you can. If you use it as a way to learn how to write good code, how to organize large programs, how to do abstract design, you can. If Shini, the light bites the details, I think not (unless you have to use the details, like the coder of the Boost library).

My understanding: May be martial arts novels to see more, I was easy to have misunderstanding is the internal strength has, what drilling will. This seems to be right, but actually in the actual study, our so-called drilling often also promote the cultivation of our internal strength. The two should be complementary and mutually reinforcing. Too much emphasis on one side will be unilateral.
Without digging into the details, it is difficult for us to understand the abstract theory. Without paying attention to the understanding and thinking of abstract understanding, we will fall into the endless details and grow slowly.

Wonderful comments:

2 floor Pongba 2007-05-16 15:30 published [Reply]

Humanchao wrote:

Such a good post why no one support it. I feel that the "high quality C + + Programming Guide" road is very real, only 100 pages, 2 hours with dim sum can be read. I will introduce this book to every new employee in the company.

"Gao" is a useful book, I have read it. But should not be used to influence the beginner's programming philosophy. Many people read "Gao" such books are easy to form a feeling, that is, the details are very important.
In fact, the right attitude is that the details are necessary. But the details are secondary.

12 Floor G9yuayon 2007-05-16 22:05 [Reply] [citation] [report]

This is a very good writing. The collection. Damien Katz rewrite the notes formula engine is not familiar with C + +, read half "C + + programming Language" and then get started. Gesture they did not know the Win32 before they developed the joint, but they also developed the joint audience while looking for manuals. It is not possible to use Google all over the land to find information.

13 Floor Myan 2007-05-16 22:08 [Reply] [citation] [report]

I think every person who has studied those details in depth will come out sooner or later. 2000 I began to study the STL, later to Loki, and then a little boost, also once thought that the more details mastered, the more skilled grammar rules, the more ingenious thinking, is the higher the level. Once with a friend in the forum to fight programming, he wrote a python program, I write a C + + program to see who concise. Write the actual product, do not have the STL, Design patterns on the loss of experience sleep. I took boost::mempool/smart pointer out and ported it on the Windows CE 3.0 platform. At that time, EVC3 only had the initial template support ability, to do a lot of code modification tailoring work. As a result, memory allocations were 85 times times faster than the wince CRT's malloc, and were happy at the time. That feeling, in retrospect today Huangrugeshi.
But by the beginning of the 03, it had been found that there were problems with this path. After all, the program is based on use, and the real useful program, but in the code is often simple, strong in the domain knowledge and innovation, the user needs to grasp and reflect on. From then on, my thoughts have undergone a painful transmutation. In recognition of their past thinking of problems, but also entered a state of confusion, loss of all language and technical details of the learning interest. What. Net,java,posix,compiler, Web,soa, fun things just a handful, most of the details are uninteresting, even ugly. This state lasted for nearly two years before it came to pass with the knowledge of Python and Ruby.
Now back to reflect, that year desperately to study those details, is to enter the wrong, but it is not a period of experience. Now the C + + community's Daniel has proposed to transform the C + + teaching path, which I certainly support. Now C + + learners can not bypass detours, can directly use those high-level abstract tools to solve the problem, do not have to struggle to understand what function overload resolution rules, not for the efficient use of memory worry, for the specific project is of course happy, but for their technical growth must be good? I'm afraid not. Less a hardship, but also a less mature.
So I think, more around the detour in fact it doesn't matter, strength or long in their own body. The key is to work hard. If I were to answer the question of "how to learn C + +", I would say, "It's hard work."

14 Floor Pongba 2007-05-16 22:23 [Reply] [citation] [report]

Myan boss mentions:

So I think, more around the detour in fact it doesn't matter, strength or long in their own body. The key is to work hard. If I were to answer the question of "how to learn C + +", I would say, "It's hard work."

Myan boss said that the next foot of course is understandable. Do everything is so, not enough time can not recognize something.
But the real question is whether the time is spent on the edge or on the blade. Is the next sufficient time to be a language lawyer or a sufficient time to engage in practice.
Only one copy of the time. This is especially true for students in China. The details of C + + are so complicated that C + + books are flying, and the core of learning language is not known for long. Because time is only one, so there is no time to learn more important programming basic skills, solve practical problems of the ability, algorithms, and so on. The latter can also achieve exercise even stronger. Therefore, it is really a matter of avoiding the real problem.
I have also experienced the Myan boss of this process. My opinion is not the same as Myan. I think time is precious, so work naturally, but the real question is where to go.
G9 boss mentions:

Damien Katz rewrite the notes formula engine is not familiar with C + +, read half "C + + programming Language" and then get started. Gesture they did not know the Win32 before they developed the joint, but they also developed the joint audience while looking for manuals. It is not possible to use Google all over the land to find information.

I very much agree with this way of work. Stealing thought this is the real pragmatic way, one with practice-driven learning has the drive, and not easy to fall for learning and learning and thus lost, sunline this very exercise people to solve practical problems of the ability. Asphyxication Such learning is the most "economic", the most efficient.

24 Floor Myan 2007-05-17 09:57 published [Reply]

To Pongba:
I certainly agree with your basic point of view, believing that everyone who comes out of the details will agree. The problem is for beginners (of course, mainly students), how to go the right way. You said: "There is only one time." This is especially true for students in China. ”
In fact, anyone who has worked for a few years can feel that the student stage is the most time-out and there is no time to work. So if you want to detour, to ponder a little language details, to do a little to eat enough to support the things, practice a bit of internal strength, preferably in the student phase walk. Of course, do you think it would be better if we didn't make a detour at the student stage? It seems better, but the detours is not really can avoid, that road is not a detour, you mean the road is so straight, not so say. Especially in the different stages of your life, you will have different views and comments about your past. My point is that, on the whole, detours are unavoidable, detours are not all bad, even in young times more detours, may be too good too good thing. You think the straight road, perhaps in the end is a bigger detour. Life things are difficult to understand, the most do not regret is tempered, the most need not worry is no chance.
As for the "Straight Road", it is very desirable for the students, can wait until the work stage, you can immediately feel what is a feeling. Every day is driven by the task, do not have their own effort to find "pragmatic" way, every day is the street bullet, even go back to practice horse, Hara gas opportunities are not many. Not to mention the language details, is some of the necessary application of mathematics, algorithmic theory and other things, can only jianfengchazhen learn a little, swallowed, solve the problem is good. In fact, you are a Chinese student in a different number, you in the student phase to engage in some "language lawyer" things, so now have some reflection, feel that they should be early on the street, and now you go to the street melee, up to the beginning a bit not adapt, once adapted, you are strong enough, because your internal strength thick. But most students, the first way they learn is the "pragmatic" street bullet you are advocating. But their results, not to write notes rules engine, not to develop a joint audience, but engaged for many years ASP, do not know the principle of HTTP, learned three. NET, but is not understand the asynchronous programming model, the first encounter BeginInvoke is afraid; wrote two years MFC program, Without understanding the Windows Event model, you can only flying blind if you encounter problems. I am not saying these words in thin air, there are real examples around me. If you put the field of view large enough, you will realize that Chinese students are not too retreat, but too pragmatic, not too pragmatism, but too pragmatic. So I think your call is appropriate for a small group of people, and it's not for the vast majority of people.
Of course, the work needs to know the details are also some, such as to do the internationalization of people, the need for character encoding problem memorized, to engage in windows to the Linux transplant, the need for Windows internal hook implementation, linux/x system internal event mechanism to understand the heart; engage in wince development, Some programming interfaces for Microsoft ActiveSync are required. These details, or knowledge technology in specific fields, are impossible to learn without a specific application background and support environment. So now large companies recruit college graduates, generally more rational, know that the students do not have that environment and conditions to engage in pragmatic, is generally not required. Depends on your foundation to play a solid not solid, there is no research spirit. The important thing is that the process, not the result, is about your stout legs, not the bag of salt on your back.
I once asked a professor at an American university, the president of an international college programming contest, what are the topics of the programming contest for real software development? He said that, in fact, they also know that it is not very useful, but the first thing in this form of the game easy to operate, the real useful things can not compete, second, it is important that the players participate in the process of the competition, to achieve the best results, often take a few years, do thousands of questions, thousands of with the actual software development does not have Finally proved that in this contest to achieve good results, in the future, most of the work can also achieve good results. You said this bend around the big, this time spent to injustice not injustice?
Finally, these words are written to you, but also to my own. 10 years ago at this time, it is precisely I have mastered C, began to aggressively attack the C + + peak. If I could be 10 years younger today and go back to college and choose again, I would probably not choose to delve into C + +, but to learn the C, to study OS, Compiler, TCP/IP, and so on. But I didn't see it that year, but I only saw C + +. Do I regret it? Not too sorry. One can only choose between one limitation and another, and if you go that way, you will regret something else today. Now I have a knowledge of it this industry chain, I feel the world is big, is a person can unforeseeable. So the global optimal is expected to be impossible, the individual can do, just the pursuit of local optimization, and then let the fate of the big waves to send you to the peak or shoot into the abyss. For example, do you think it must be good to study abroad? Do you think it's good to be hired by a top-notch company? Do you think you write a software at the student stage, make the world famous, all people admire, there must be a good ending? Really not necessarily ah. But not necessarily, is it possible for us to be fooling around and loafing around? Of course not. The global optimal can not be expected, but the local optimization must strive to follow their own route to a steadfast effort to achieve the best possible results. So, if you want to be a good language lawyer, just work hard to do it, nothing wrong. Or that sentence, the next foot Kung fu, a good physique, more important than anything. If regret, I do not regret the choice of technical route, just regret that time is not enough, or to take out too many times to watch TV, eat barbecue.

34 Floor Yylfyy 2007-05-17 21:34 published [Reply]

Personally think Myan eldest brother and Pongba boss said is correct, drilling and internal strength, knowledge and skills, is a matter of opinion (some like the previous time Jin Xu-liang teacher and Yuanfeng boss's view)
I personally like to drill down to the bottom of the details, like the "C + + Primer", like to see the Lippman deep in the underwater things are turned out to show everyone, but also very stubborn that no master OS and Win32 before, absolutely do not touch VC or BC.
Time is also very confused, because the study for so long, now also can not write a decent thing out. Pongba boss said the details of the problem response in the forum, Myan boss said the pragmatic problem response in school, it is true.
No one in school cares if you understand the parsing of overloaded functions, or the assorted of pointers to function pointers arrays. What You made an aviation management system with Dephi! "This online answer system is you use Java design?!" Cow! "This is usually the case. On the one hand, the enterprise's requirements for project experience, on the other hand, is the student's own "knowledge" of the idea, the combination of the two, there appeared Myan boss said the kind of "Chinese students are not too retreat, but too pragmatic" view. Yes, learn the useless things, who will learn. "Learn OS can write operating system?" "Can the compiler write complier?" "No, so it might be more useful to learn how to drag and drop controls in C + + Builder to paint a drawing program."
Forum on the different, master low hand gathered a hall, can write aviation management system What, can write virtual machine people are more than count. Of course, there are few people who can tell the name of a class template. Can develop the project, can write the bottom, but if give a university C + + paper, can say whether can pass. The details of this, on the network, we all like to put the underlying mechanism of language play over and over.
I think Myan the boss is that after work is not like in the university, there is enough time to learn the details and the bottom of the system, so the emphasis on the university during the cultivation of internal strength. Pongba from C + + learning to analyze the way of the study of program design, emphasizing not to die key details, after all, programming is not purely language control. Two of the bosses are in a good position to speak.

Read Liu Weipeng "How you should learn C + + (and programming)"

Related Article

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.