Analysis of C ++ tutorials

Source: Internet
Author: User

Once we know that C ++ has a need in some fields, it is worth learning and mastering, next we can discuss the core issue of "how to learn and master C ++ correctly.

In fact, Bjarne has been promoting this issue for ten years. As early as 99 years ago, Bjarne wrote "Learning C ++ as A New Language". In several technical interviews, here, here, and here) this section describes how to correctly treat and use various abstract mechanisms supported by C ++. Andrew Koenig also wrote a modern C ++ tutorial "Accelerated C ++" which will be mentioned later ). But has the C ++ community improved over the years?

As far as I know, improvements are very small. The learners still blindly drill down the language details, only to see the trees not see the forest; there are still various "technical" articles and unreliable "learning C ++'s XX suggestions" on the Internet "; some industry-specific experts are still writing skills and corners that ordinary programmers don't need in their eight lives ); companies that really use C ++ in the industry always ask some detailed questions during the interview, rather than examining the basic literacy of programming, mastering all the language details cannot make you a qualified programmer ).

This interview philosophy is wrong. It is estimated that the reasoning behind it should be "if this guy doesn't know the details, then he may not be familiar with the language. If he knows, although he may not be a good programmer, we can continue to test the next problem. "The problem with this idea is that, if you are familiar with the language to a certain extent, we will provide specific suggestions later.) You can program well. For the rest, you only need to check the documentation );

However, many companies are far away from testing their "familiarity with the language". For example, it is understandable to ask about the life cycle and structure sequence of temporary objects, but how can I avoid a class being copied or how can I avoid it being built on a stack ?); Of course, some language knowledge must be mastered in advance. Which of the following statements will be mentioned later? During the interview, the key is not to ask about the language details ".

So:

Fact 3: the entire ecosystem of C ++ has not improved much in studying the philosophy of C ++ over the past few years.

Why? Is it because the learning method introduced by Bjarne has not come up with ideas technically? Is Andrew Koenig not well written? No one will believe it. In fact, the reason here is not technical, but non-technical.

As we all know, the most serious problem with C ++ is that it takes too much time for learners in the language learning stage. Turning over your C ++ bookshelves or e-book directories, the vast majority of C ++ "classic" are speaking languages. In our general sense, it usually takes two or three years to get started with C ++. To be "proficient" in C ++, it may take more than ten years. This is not the same as Peter Norvig's "ten years of learning programming". People say programming skills in the general sense, rather than asking you to be a language lawyer .)

Why do I say "the complexity of C ++ is the root cause" is a reasoning with loopholes? Because it takes a lot of time for people to learn the complexity of a language before using a language to do things. In addition to the fact that the language itself is complex, there is also an important fact, that is, the attitudes and more important methods of learners. What are the attitudes and methods of most C ++ learners? -- Before using C ++, reading a stack of language books may not be used for eight years ). Why is there such a learning attitude? This is the question that really needs to be explained. In fact, there are two reasons:

Fact 4: The vast majority of C ++ books on the market, including many widely known as "must-read Classics", are actually negative textbooks.

That is to say, if you pick up any C ++ book, including many popular "must-read Classics", it is very likely that the content in this book is not what you should learn, you should not learn it. I say this for two reasons, because I used to be a victim. Second, it is also a more substantive reason. These so-called must-read Classics are filled with the traps introduced in C ++ and the various workarounds for the defects of C ++. Idioms is a good habit) or techniques technology ));

This kind of traps and defects in C ++ are countless, so a long tail is pulled out "; such books have "C defects and traps", "objective Java", and "Objective C #" in all languages. However, in C ++, this tail is very long, as a result, there are countless such books. 3. The defects and traps listed in these books do not distinguish between common levels. For a programmer, we should want to see the order from the most common problems to the least common problems to list the content. However, these books are either all mixed together, either introduce the content according to technical categories such as "Resource Management, class design, and generics", which is useless if I see the content of a chapter, of course, do I know whether it is about class design or resource management ?), This makes it impossible for a learner to identify and spend the most important time on the most common problems.

The most important thing is that the content introduced in these books has nothing to do with being a good programmer. They can only tell you at most-hi, be careful to fall into this trap. Or tell you -- hi, you know that you may not have met this requirement in your eighth life. Can you solve this problem with this technique? As a result, after reading another book, your head is full of symbols such as "forbidden", "alert", and "Lightbulb", but the true programming quality is not growing.

Or there is a kind of book that is keen on the mechanisms behind language implementation. But what is the essence of language? It is used to abstract the actual encoding. A nice point is "design". It is not used to tell you how this feature is supported. For example, I have met the following scenario: the interviewer asked, "Do you know about virtual functions ?" The answer is a bunch of explanations about the virtual function table mechanism. The interviewer asked: "What are the advantages of virtual functions ?" Why are virtual functions required? The answer is: "Well... Ah... Is... Polymorphism. "At this time, I felt that the answer was not profound enough ). Ask: "What is polymorphism ?" Speechless.

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.