views:

323

answers:

12

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.

A: 

Creating a COW (Copy On Write) String class ?

Romain Hippeau
What is a COW string?
Goose Bumper
@Goose Bumper expanded COW and put a link in the answer
Romain Hippeau
A: 

Concurrency and thread management?

Lars Andren
+13  A: 

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.

AraK
Ah, I forgot to mention this. +1 for Exception Safety!
Josh
+Inf for exception safety, too often forgotten.
spong
+11  A: 
  • Concurrency. Most students don't cover this and it's a growing necessity in modern computing, as they get more CPUs.
Stephen
Preferably using `boost::thread` or better using the coming `std::thread` :)
AraK
Concurrency is important, but I think it's learned just as well in a language-agnostic way. There are more interesting things that a class specifically on C++ could cover.
Tyler McHenry
Actually, this was on the top of my list too. I think it's very important.
Goose Bumper
I think the topic of Concurrency in general deserves another course on its own, unless you mean the facilities that are available for C++ programmers.
AraK
I agree with you all that Concurrency is a large concept and can be given its own class. I disagree that it should only be learned "language agnostic". The concepts are language agnostic, but you should put them to work in practice. It's often talked about in Operating Systems classes at the theoretical level. Too often students graduate without having implemented anything but the most trivial program using "fork()". That's not enough.
Stephen
A: 

Some cases studies from GOTW

Anders K.
A: 

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.

wilhelmtell
templates completely changed how I program. I would also add preprocessor, the way boost do, to generate code. in my opinion preprocessor is too often overlooked
aaa
We went as deep as chapter 3 of modern C++ design, so there's still more that could be done, but I'd rather learn new topics and dig into template metaprogramming on my own.
Goose Bumper
@Bumper you lucky dude, I wish that had your professor
aaa
@aaa: lucky indeed, he's on the C++ standards committee, so he knows the language like the back of his hand :)
Goose Bumper
A: 

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.

Kotti
+1  A: 

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

aaa
A: 

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

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

Josh
My teacher is on the C++ standards committee, so he considers all this "basic" (although important)...we covered it all in the beginner's C++ class.
Goose Bumper
That's good to hear. I know some people who barely learned classes in their beginner c++ courses!
Josh
A: 

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.

Norman Ramsey
+4  A: 
  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
frankc
A: 

Reflection and RTTI.

Raul Agrait