开发者

What should my teacher talk about in my Advanced C++ class? [advice needed] [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guid开发者_运维百科ance. Closed 10 years ago.

My teacher for Advanced C++ has opened the class up for students to suggest whatever topics we want. What are some good advanced C++ topics to know? We've already covered:

  • template metaprogramming
  • the STL (obviously)
  • introduction to the boost libraries

Please give reasons for suggestions as well.


1) Exception Safety + RAII. Because this is the part where I find C++ very different from other languages I know. It is easier to do exception handling in C++ if you understand the rules and why they are set that way they are, especially how to benefit from RAII when doing exception handling.

2) Introduction to C++0x. Because I can't wait any more the fourth edition of The C++ Programming Language ;) If you have the chance to learn some useful facilities you would be ready for the transition.


  • Concurrency. Most students don't cover this and it's a growing necessity in modern computing, as they get more CPUs.


  1. Consequences of C++ design on C++ compilers
  2. related: failure of the export keyword and why no one implements it
  3. Custom allocators
  4. placement new/delete and when you actually want to use them
  5. Design of a C++ garbage collector

Also, if you only started out with C++ and did not come from pure C, it might be worth going in a low level direction rather than a high level direction:

  1. Understanding the proper use of 'volatile'
  2. linking C++ with other languages (ie calling java or fortran from C++ or vice versa)
  3. performance analysis and tuning of code


I would say lambda, either in boost or in C++ 0x. this is not something people will find on their own most likely, but I think it allows to reduce code and maintenance significantly. Plus changes the way you look at programming in certain way. moreover, it gives solid introduction to functional programming.

for example, you can sort collection very concisely using some weird requirement:

std:: sort(begin, end, lambda::_1 + lambda::_2 > 0);

I would also add template expressions. I am currently playing with them, they are powerful tool to produce very efficient code while maintaining very close resemblance to problem description. plus, I do not think any other language has similar facilities. http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Expression-template


Concurrency and thread management?


Some cases studies from GOTW


How much of template metaprogramming have you done? This deserves a full course, so if it ignited your imagination you might want to dig into that farther. Diving deep into template programming will get you a long long way into modern C++ programming.


Patterns, real application building, app architecture design, etc. Everything else (you mentioned boost libraries, STL, etc) can be easily discovered while self-educating, but good and rational design is much harder to learn.


It wasn't clear if this was covered in your existing knowledge, so a few "advanced basics" are noteworthy:

  • Multiple inheritance
  • Polymorphism
  • Operator Overloading
  • Advanced Streams, creating custom streams
  • Socket programming

and possibly GUI programming although most likely this is a separate course altogether.


C++ concepts, which if eventually adopted, will make it possible to typecheck templates and to get sensible error messages. You could study recent papers by Jeremy Siek and by Gabriel Dos Passos and Bjarne Stroustrup.


Creating a COW (Copy On Write) String class ?


Reflection and RTTI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜