views:

484

answers:

7

I have a good understanding of OO from java and C# and I'm lucky in my engineering courses to have been exposed to the evils of both assembler and C (pointers are my playground :D ).

However, I've tried looking into C++ and the thing that gets me is the library code. There are so many nice examples of how to perform the bread and butter tasks in java and C#, but I've not been able to find a good explanation of how to do these things in C++.

I'd love to expand my knowledge into C++ to add to my skillset but I've not had a chance to be exposed to people and communities that are keen on these things.

Could anyone here recommend some good open source projects or tutorials which are useful. Bonus marks if they involve coming from java or C# into this environment.

+2  A: 

I think the answers in this thread apply:

http://stackoverflow.com/questions/403431/switching-from-java-to-c-whats-the-easy-way/403490

Edouard A.
+4  A: 

Hi Spence,

I don't have any such resources for you, unfortunately, as I took the long way of slowly discovering things piece by piece.

I do have a caveat for you, though: keep in mind that in the C++ world, the standard library has been very slow at providing useful services. Basically, you'll find a few algorithms, data structures, a few string-related classes and some basic I/O-related ones. Unlike Java or .Net, there is not an extended library of classes for all kinds of purposes (networking, file system services, cryptography, concurrency, etc) - the closest to that is probably Boost, which looks and feels like an extension to the standard library, but which is still external (although some parts of it are leaking back to the standard library).

Carl Seleborg
Yes, I've been doing quite a lot of reading about Boost, some of their stuff (especially smart pointers) seems very very interesting.I guess without a good library its a lot more difficult to get to the point where your code is usable.
Spence
Boost is a must have library, however it's advanced C++: understanding its internals is difficult for a beginner.
Edouard A.
Ed: same could be said of any large library framework. "Python's batteries included is a must have, however understanding Python's internals is difficult for a beginner"
Aaron
+7  A: 

I'd suggest that you work your way through the excellent Andrew Koenig and Barbara Moo book "Accelerated C++" (sanitised Amazon link). This book teaches you C++ rather than assume that you know C and then look at the C++ bits bolted on.

In fact, you dive in and are using STL containers in the early chapters.

Highly recommended.

HTH

cheers,

Rob

Rob Wells
+1  A: 

Assuming you already have some knowledge of the C++ syntax, and have good Object Oriented experience I'd go for Effective c++ series.

It's a collection of "tips and tricks" explaining how c++ works under the hood. Which are the common misunderstandings from people coming from other languages and why c++ works this way.

davidnr
+4  A: 

As well as the other answers here, I think you should take a look at the QT toolkit. Not only does it have GUI widgets, it also has libraries to work with things like databases, multithreading and sockets.

A combination of BOOST and QT, IMHO, provides you with the tools to address in C++ any problem you might be faced with.

Richard Corden
If I could mark two answers here I would. Maybe I should of asked two different questions instead. Your answer addressed my library issue. Cheers :)
Spence
+2  A: 

It's worth bearing in mind that C++ is primarily a systems programming language. Thus its main emphasis is not on performing bread & butter tasks but on writing the tools that are used to perform those tasks. For example, rather than supplying database access libraries out of the box, C++ is intended to be used for writing the database engine itself.

anon
+1  A: 

It depends what platform you are programming on. C++ itself doesn't have the same sort of library that Java or C# have. That sort of functionality is traditionally supplied by the operating system. I suggest you learn C++ from a book (I like C++ Primer by Lippman but it may be a bit slow as its aimed at beginners) and then head to MSDN if you are programming on Windows. There are APIs for networking, XML parsing, encryption, just about everything you need. They are just tied to the OS instead of the language itself.

I don't know the equivalent resources for Linux or the Mac but I'm sure someone can supply them.

Steve Rowe