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.

I have some experience in Java programming and enterprise application development. I have done OOP, data structures in C++ for my undergraduate studies. But I couldn't touch C++ for years. Now I am interested in C++ again and I would like to polish my C++ knowledge and become an expert in C++ . How do I start my journey in C++ again?

In this journey would like to learn some advanced concepts in C++ like network programming, distributed computing,.. etc.

share|improve this question
3  
practice, practice and a bit of practice –  ratchet freak Jan 15 '13 at 10:27
1  
@ratchetfreak: I would add to that a lot of reading (e.g. stackoverflow.com/questions/tagged/c%2b%2b). Also forgetting Java should help a lot. –  Benjamin Bannier Jan 15 '13 at 13:20
    
The SO chatroom is the only place to go. –  DeadMG Jan 15 '13 at 14:26
add comment

closed as not constructive by Oded, thorsten müller, gnat, Martijn Pieters, Manoj R Jan 15 '13 at 12:28

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 guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

up vote 2 down vote accepted

Obviously there are a lot of areas you can look at, STL and Boost libraries spring to mind, but as an ex-Java developer you need to fix up the basic concepts that are different first.

Chief amongst these is object lifetimes, in Java you have a GC and finalisers and all that, with C++ you have explicitly defined scopes and deterministic places where your object will (automatically) go away when it leaves scope. Typically you create an object on the stack rather than the heap in C++, and let the compiler decide when to free it. Do not think that you have to create all objects on the heap and let the GC decide when they're no longer used. If you do need a longer lifetime object, or a large one that would suit living on the heap, use a smart pointer class to manage it. You might want to check up on the latest spec with its features like lambdas and especially the move operator syntax too.

Google for RAII and make sure you learn C++ scopes, its trivially easy, but like many things that are easy you need to take the small amount of time to understand them.

share|improve this answer
add comment

Disclaimer: What you read here are my personal ideas and they are not necessarily correct or widely accepted.

In short, practice! and probably more practice. If I want to talk in detail, there are few things that I like to point out. I was in more or less the same situation, having some experience in java and knowing c++ in surface.

To master c++ neither books nor video lectures were so much of help. Don't get me wrong, books are fine but in my case, it was only a matter of checking syntax or knowing the concept in detail. What really helped me, was developing couple of very serious projects with c++ and while doing that, I pretty much mastered some of the most important concepts. So again, practice, doing projects and meanwhile knowing what you are doing. By "knowing what you are doing" I mean you should know what exactly your code is doing (e.g. what is the difference between pass by reference and pass by pointer and etc).

Moreover, you should learn some details like how the compiler and linker work, what are macros and more. The point is, java is very nice language when developing(personal opinion); it's easy and fast to develop and you don't really need to be worry about lots of programming aspects. C++ on the other hand is not that easy. If you want to really master the language, you should know about the details of compiler, linker, macros, debuggers and etc.

I don't want to start a battle of operating systems here but I strongly suggest to work with linux. Nice architecture of linux allows you really see how things work and tools like cmake (which is cross platform btw) allows you to have a better understating of the compilation process. If you don't wanna use linux, at least forget about automated IDEs like ms visual studio where everything happens with a simple click.

But if I want to make only one suggestion, I have to repeat again: PRACTICE!

share|improve this answer
    
I think the OS suggestion is misguided: Learning a new language is IMHO best done in the environment you know best. If you're a comfortable *nix user, then by allmeans *nix is an option for the environment to learn (c++). On the other hand, if all you know is Windows, then reccommending to use Linux just because some tools may be slightly better is doing a disservice, because wolrking on a different platform than the one you're used to will just create a lot of little problems that you ave to deal with instead of concentrating on learning the language. –  Martin Ba Jan 15 '13 at 12:08
add comment

I would suggest one piece of advice, go on stackoverflow, look for unanswered questions about C++ and try and answer them. The amount you learn from answering questions is immense, and you'll be surprised how often they tend to crop up as issues further down the line for you.

share|improve this answer
add comment

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