6

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.

Tim
  • 35,413
  • 11
  • 95
  • 121
Vlad the Impala
  • 15,572
  • 16
  • 81
  • 124

12 Answers12

14

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.

Khaled Alshaya
  • 94,250
  • 39
  • 176
  • 234
12
  • Concurrency. Most students don't cover this and it's a growing necessity in modern computing, as they get more CPUs.
Stephen
  • 47,994
  • 7
  • 61
  • 70
  • 3
    Preferably using `boost::thread` or better using the coming `std::thread` :) – Khaled Alshaya Apr 23 '10 at 01:50
  • 2
    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 Apr 23 '10 at 02:04
  • Actually, this was on the top of my list too. I think it's very important. – Vlad the Impala Apr 23 '10 at 02:13
  • 1
    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. – Khaled Alshaya Apr 23 '10 at 02:21
  • 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 Apr 23 '10 at 14:21
4
  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
  • 11,290
  • 4
  • 32
  • 49
1

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

Anycorn
  • 50,217
  • 42
  • 167
  • 261
0

Creating a COW (Copy On Write) String class ?

Community
  • 1
  • 1
Romain Hippeau
  • 24,113
  • 5
  • 60
  • 79
0

Concurrency and thread management?

Lars Andren
  • 8,601
  • 7
  • 41
  • 56
0

Some cases studies from GOTW

AndersK
  • 35,813
  • 6
  • 60
  • 86
0

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
  • 57,473
  • 20
  • 96
  • 131
  • 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 – Anycorn Apr 23 '10 at 01:59
  • 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. – Vlad the Impala Apr 23 '10 at 02:10
  • @Bumper you lucky dude, I wish that had your professor – Anycorn Apr 23 '10 at 02:14
  • @aaa: lucky indeed, he's on the C++ standards committee, so he knows the language like the back of his hand :) – Vlad the Impala Apr 23 '10 at 02:48
0

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.

M. Williams
  • 4,945
  • 2
  • 26
  • 27
0

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
  • 10,961
  • 11
  • 65
  • 108
  • 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. – Vlad the Impala Apr 23 '10 at 02:11
  • That's good to hear. I know some people who barely learned classes in their beginner c++ courses! – Josh Apr 23 '10 at 02:13
0

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
  • 198,648
  • 61
  • 360
  • 533
0

Reflection and RTTI.

Raul Agrait
  • 5,938
  • 6
  • 49
  • 72