How to learn C + +----Master words

Source: Internet
Author: User

How can you master C + + in a year's time? Modify have a certain C language foundation, future want to engage in the game development work, give oneself a year time, can be proficient in C + + during this period?

Milo Yip, game programmer, "game engine architecture" translator Zhang Mache, What, the wind-seekers Others agree that I have been learning and using C + + since about more than 20 years ago, but I still haven't reached the stage where I think "proficient", even the new features of c++11 have been mastered. However, because I was in the study of C + +, but also the game programmer (the original problem referred to the main topic want to engage in game development), I think may be able to provide a few comments for users reference.

First of all, the August 2010 "Programmer" published the humble article "C + + powerful behind "Last paragraph:
C + + Learning recommendations

One of the drawbacks of C + + is that it is relatively complex in many languages and difficult to learn. Many people say that learning C only requires a K&R C programming language , but C + + books are numerous. I went from c to C + +, all by reading self-study. Share a little learning experience here. Personally, learning C + + can be divided into 4 levels:

  • First level, C + + Basics: Pick a starter book, like the C + + Primer, "C + + University Course", or Stroustrup wrote the classic C + + programming languageOr his new book, "C + + programming principles and practices", 1.5 ago, while the general C + + course also ends here, plus the C + + standard library"The C + + standard Library Extensions"Available for reference;
  • The second level, the correct and efficient use of C + +: This level begins with self-study, has read the (more) Effective C + +"," (more) Exceptional C + +"," Effective STL "and the C + + programming specificationAnd so on, it is appropriate to step into the professional C + + development Road;
  • Third level, in-depth understanding of C + +: A global problem-readable "in-depth exploration of the C + + object Model", "Imperfect C + +", "Meditation on C + +", "STL Source Analysis", to challenge IQ, can see the template and template meta-programming books such as "C + + Templates", "C + + Design new thinking", "C + + template meta-programming"
  • Level four, study C + +: Reading the design and evolution of C + + language, "The nature of Programming"(including the Mathematical Foundation behind STL Design), C + + standard document "ISO/IEC 14,882:2003", C + + standards CommitteeProposals and reports, academic literature on C + +.

Since I'm mainly applying C + +, I'm only on the second to third level. However, C + + is just a part of software development, and language alone cannot cope with business and engineering problems. Readers are advised not to force a few years to "thoroughly learn C + + knowledge", to reach the second floor from the actual work to learn from the experience, interested in slowly continue to learn a higher level of knowledge. Although learning C + + is difficult, it is also quite interesting and satisfying.


If the master thinks that "mastery" refers to the second level referred to above, then I estimate that one year full time is not enough "proficient". First of all, it takes time to read the books themselves, and for the average person (except for someone who has a strong ability to learn and remember), it may take several times to memorize some details. In addition, you must practise after reading. In addition to the introduction of the exercise, but also need to do some engineering projects to understand the various grammar, programming paradigm use and timing, ideally recommend to participate in some open source projects. However, learning is the need to constantly think and precipitate results, including discussions with friends, blogging, and answers, all of which take time.

As pointed out in the last paragraph of the citation, I suggest not to "master c++" as a one-year goal, we should use language learning as a continuous process, but also to apply language in specific applications. "

---------------------------------------------------
Discuss C + + and game development again.

See a lot of answers to discuss the technologies that are necessary for C + + game developers. I don't think this is completely necessary, but many game development projects need to be in C + +. Here are some of the game platforms/types that have been popular in the past:
    1. PC stand-alone game (Windows)
    2. PC Network games (Windows, Linux)
    3. Mobile platform Games (J2ME, Symbian, Palm ...) )
    4. Home console games (PS1/2/3/4, XBox, Wii ...) )
    5. Handheld Gaming Game (GB, GBA, NDS, PSP ...) )
    6. Web games (HTML, Flash)
    7. Smart mobile device Games (IOS, Android)
We will find that in addition to J2ME and web games, most platforms support (or only support) native programming. The most common use of native programming is C + + and assembler. This phenomenon is not difficult to interpret, again quoting the humble text:

should I choose c + +
which programs are appropriate to use C + +?

  • c++ is suitable for the more stable parts of the construction program, which can use scripting language for the parts with larger requirements, and
  • program should maximize the performance of the hardware, And the performance bottleneck is CPU and memory,
  • The program must use C + + frameworks/libraries, such as most game engines (such as Unreal/source) and middleware (such as Havok/fmod), although some C + + libraries provide bindings for other languages, but usually native APIs are best and up-to-date;
  • a target platform in the project provides support for the C + + compiler only.

  • To a large extent, games--or game engines--are a very good time to apply C + +.

    Some people think that the game developers use the off-the-shelf engine, there is no need to use C + +. In the past, the industry had a common sense that the game engine was developed in C + +, while the game engine provided the scripting engine for writing game logic code. But this view was changed by Unreal Engine 4 decision, UE4 abandoned the maintenance of many years of UnrealScript scripting language, and the use of native C + + as the game Logic programming language. There are a number of reasons behind this decision, but just to cite this example to demonstrate the use and trend of C + + in game development, the specific reason analysis will not be expanded in detail.

    In addition to developing our own game engine using C + +, we can see that most game engines provide their C + + original code (unity is an exception), which allows us to
      1. Easy to debug games
      2. In-depth analysis and optimization of game performance
      3. Extending new functionality for the engine
      4. Modify an existing engine to fit your project needs
    In the professional game development, these are very common work tasks. So, even if you are not self-researching engines and developing game logic using scripting languages, there are plenty of opportunities to use C + +.

    Finally, "What else to learn" is a difficult question to answer because game development involves a wide range of knowledge. Suggestions can be referred to my translation.

    How to learn C + +----Master words

    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.