|
发表于 2009-11-2 01:37:04
|
显示全部楼层
IP:江苏扬州
How long does it take to learn C++?
That depends on what you mean by "learning." If you are a Pascal programmer, you can easily learn enough of the basic types, control structures, and library functions to be effective at what you were effective at using Pascal. Will it take a day or a week? That depends on you and the approach you take. I have seen both and even wider variations. If you are a C programmer you can learn enough C++ to make you more effective at C-style programming in a day.
On the other hand, if you want to be fully comfortable with all the major C++ language constructs, with data abstraction, Object-Oriented programming, generic programming, Object-Oriented design, etc., you can easily spend a year or two - if you aren't already acquainted with those techniques.
Is that then the time it takes to learn C++? Maybe, but then again, that is the timescale we have to consider to become better designers and programmers. If a dramatic change of the way we work and think about building systems isn't our aim, then why bother to learn a new language? Compared to the time required to learn to play the piano well or to become fluent in a foreign (natural) language, learning a new and different programming language and programming style is easy.
How do I start learning C++?
Naturally, that strongly depends on what you already know and your reasons for learning C++. If you are a novice at programming, I strongly recommend that you find an experienced programmer to help you. Otherwise, the inevitable mistakes about language concepts and practical problems with the implementation you use can magnify into serious frustrations.
You'll need a textbook for learning C++. This is the case even when your implementation comes with ample on-line documentation. The reason is that language and library documentation together with sample code are not good teachers of concepts. Typically such sources are silent about why things are the way they are and what benefits you can expect (and which you shouldn't expect) from a technique. Focus on concepts and techniques rather than language-technical details.
When choosing a book, look for one that presents Standard C++ and use the standard library facilities in an integrated manner from the start. For example, reading a string from input should look something like
string s; // Standard C++ style
cin >> s;
and not like this
char s[MAX]; /* Standard C style */
scanf("%s",s);
迷信权威
可到哪去找有经验的指导我? |
|