Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

So I'm a recent college graduate, and I really enjoy working in C++; I worked with it a lot in school, and would like to pursue a career writing in C or C++. The problem I'm having is that I'm trying to learn the nuances of C++. I'm not talking about the basics, or even advanced concepts like templates, namespaces, etc.

I'm talking about the real nitty-gritty stuff like undefined behavior and stuff like that. When I'm interviewing, and they put a bizarre piece of C++ code in front of me, and ask me what the output will be, I want to be able to nail those questions. Obviously experience is a great way to learn, but when I write code for practice, I [obviously] know what it does.

Reading open-source projects have been good practice, but I find that there tends to be an enormous learning curve just understanding the organization of the code (because the projects tend to be large). So basically what I'm asking is, what should I do now?

share|improve this question
2  
check it out stackoverflow.com/questions/75538/hidden-features-of-c –  Sergey Jun 21 '11 at 6:46
add comment

7 Answers

To become a real good C++ programmer most people will need several years. C++ is a very complex beast with lots of dark corners and hidden twists, and a lot of stuff to remember.

What you can do to speed things up:

  • Pick at least one high-level C++ community and start to read questions and answers there to become confident enough to post your own answers. (Nothing points out your own shortcomings as well as trying to teach others.) Both the comp.lang.c++.moderated newsgroup or Stackoverflow are good candidates for this, although comp.lang.c++.moderated usually has more detailed discussions about issues coming up.

  • Get the C++ standard and try to follow the discussions revolving around quotes from it in the above mentioned communities.

  • Read good advanced books on C++.

  • Write code. Seriously, all theory won't make you a good programmer anymore than no theory does.

Oh, and you are certainly very welcome to Stackoverflow's C++ chat room. Sometimes we even discuss C++ there. But don't count on it.

share|improve this answer
    
If you're very lucky. –  DeadMG Jun 21 '11 at 11:14
1  
+1 particularly for the books (particularly the Effective C++/STL ones). I think that might be the priority to learn the dark corners and hidden twists. –  Klaim Jun 24 '11 at 9:21
add comment

There are a number of must-read classic books for when you're beyond the beginner's stage of C++:

share|improve this answer
7  
After reading "Modern C++ Design", watch out so that you don't catch templatitis! –  quant_dev Jun 27 '11 at 9:57
2  
Also, Bjarne's "Design and Evolution of C++" should be on that list. Good stuff about understanding the foundation of today's result. –  Macke Apr 8 '12 at 19:36
add comment

At your level, I think the best way to learn C++ is to divide-and-conquer. Quoting from Scott Meyers "Think of C++ as federation of languages, rather than one language". To understand C++ well, I will suggest to learn procedural, OOP and template paradigms first and memory management as well. Those topics are actually one level higher than the C++ syntax that you mentioned.

You will learn the syntax as you go, but learning the methodologies and memory will set you far. Learning those concepts is short comparing to all the syntax and mechanics but you have to think a bit more. In contrast, learning the syntax is more on memorization than thinking.

Good luck.

Armando.

share|improve this answer
add comment

First bit of advice: learn to be an effective writer as well. Your post needs paragraphs.

Next bit: if you want to become an expert on UB you should get a copy of the standard and try answering questions in comp.lang.c++.

share|improve this answer
3  
I would prefer StackOverflow instead of comp.lang.c++ –  Jonas Jun 21 '11 at 6:50
1  
@Jonas: clc++m does have its merits, though, in that they are actually discussing things there, rather than just giving answers as is done at SO. If you want to gain deep knowledge, following the discussions might be more tedious, but is also more rewarding. –  sbi Jun 24 '11 at 9:36
    
@Jonas - Not I. In comp.lang.c++ you can killfile the trolls. –  Crazy Eddie Jun 28 '11 at 19:34
add comment

I found the C++-faq-lite to be a very good learning tool along with the Effective books by Scott Myers.

You'll never learn it all though!

share|improve this answer
add comment

My Suggestions:

  1. Read StackOverflow! I've learned a ton from just reading the code people post on SO, you should do it too.
  2. Effective Books/Best Practices Best Practice books are great!
  3. Read the Official Docs You'll be surprised at how much you've missed!'
  4. Read this and this
  5. Program, Program, and Program more, there is nothing more benificial to your skills than writing code (except being named Jon Skeet of course)
share|improve this answer
    
Why downvoted?? –  Billjk Apr 9 '12 at 13:08
    
The official docs sited here aren't actually official docs. Plus cplusplus.com has known issues.. –  jozefg Jul 6 '13 at 12:31
add comment

Maybe buy a book that has commonly asked c++ interview questions. There, you will likely find questions of the type you are trying to master and you can practice nailing them!

You can also look at sites like top coder and try and decipher some answers submitted by others for their coding challenges or exercises.

good luck!

share|improve this answer
1  
Thanks! I own a couple of programming interview books, and they are spectacular for interview questions (obviously), but I feel like I'm only learning a small subset of the things I should know. I've mastered the questions in those books, but have rarely been asked those questions...there's just too many possible crazy little questions! –  prelic Jun 21 '11 at 5:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.