tags:

views:

181

answers:

6

Possible Duplicates:
What is the best approach for a Java developer to learn C++

How would you go about learning C++ if you were "Stuck in your ways" with newer languages like Java or C#?

I've been working as a developer for 3 years, I've got both a Bachellors and a masters in computing science from a Reputable UK University...

I've written millions of lines of C# thousands of lines of Java and a few hundred lines of C...

But I don't know C++, I feel a little like I've cheated the profession by not knowing a what I think is a key language. I've written Code in C++ files, mainly for bug fixes, but it was really just C in disguise.

What is the best way to go about learning C++, if you are more used to the nice abstractions that higher level languages give you to get away from the nitty grittyness of C++.

Has anyone on SO gone from being an experienced Java, C# (or some other language) developor to a C++ programmer? if so how did you do it, was it difficult and do you have any pointers?

+4  A: 

By reading Stroustroup's C++ Programming Language. Switched from Common Lisp.

Anton Kazennikov
+1  A: 

I have an idea: try looking up all those "Java for C++ Programmers" articles, because there are so many of them. They're written for those who took the historical path (like I did), but it seems like there ought to be an awful lot of useful information, examples, etc., of what the parallels are and how they're different.

That, and spend a lot of time developing in C++ :-)

jbm
A: 

Since you already have some C programming skills, I would suggest Expert C Programming: Deep C Secrets by Peter van der Linden. It has a great section on C++ to get you from C to C++. That should get you running with C++ syntax. Of course you can go straight to the Stroustrup if you feel more hungry...

Get a good C/C++ compiler and get working...

Demi
+1  A: 

Pretty much like you do any other language. Pick a project to work on and write it in C++. Immerse yourself in the language by reading C++ code to pick up on proper idioms. Reading good books like Effective C++, etc... will help you write correct C++. C++ is a really nice language that gets beat up a lot by the C# and Java programmers, so try and go into it with a positive mindset.

NobodyReally
A: 

I would probably start by concentrating on the commonalities among those language that you already know somewhat, i.e. namely the C syntax, classes and encapsulation from Java/C#, and from there on it's mostly a matter of the different types in C, and well pointers of course, as well as manual memory management.

A pretty good multimedia introduction (flash video with animations) to the C-family of programming languages is provided by Bruce Eckel's Thinking in C.

Once you got these basics sorted, I would recommend to concentrate on getting to grips with the STL and eventually boost.

Also, one thing that might be worth a try in order to get started actually using your new knowledge, might be to start splitting your future projects into distinct modules, where certain components/parts could possibly be implemented in C++.

This encourages modular design and will provide for a way to actually learn new things and apply your knowledge step by step. This could be done for example by planning to implement one tiny part of a new project as a DLL or in managed C++ code.

And in cases where you find that you cannot directly use/embed C++ components, you could still try to follow a C++ oriented approach, deliberately sacrificing some of those Java/C# facilities that you know are not available in C++.

In other words, there's usually a common denominator between platforms and languages, in network programming it's for example BSD style sockets, on Windows there's often the possibility to make use of the Win32 API.

none
A: 

Try this question.

Charlie Martin