tags:

views:

159

answers:

6

Possible Duplicates:
What C++ open-source projects have good and clean code to learn from?
Code reading: where can I read great, modern, and well-documented C++ code?

I'm looking for something readable with good OO design, in the medium size-range. I'd call myself an advanced beginner in OO programming, and I'm hoping to find and improve my deficiencies by reading code written by more experienced developers.

+1  A: 

Might not be exactly what you want, but Qt has excellent documentation, and a very good selection of example projects which are very good sources of information.

Gianni
A: 

Well, there's anything written by me of course...but it's all proprietary and I own none of it.

Since you're language choice seems to be C++ (since you tagged a language agnostic question with C++) I'd drop OO and learn generic programming. Then I'd direct you to the boost source code.

Generic programming is sort of an abstraction above OO. You'll still use objects but the focus will be different. The same principles apply but I find it's more powerful.

Noah Roberts
A: 

I'd probably go to some place like CodeProject.com, and browse to find something you find interesting. Of course, not all of the code there is exemplary, but I think you're probably better off looking at various styles to see what tradeoffs there are between different ways of doing things, not just reading one (or a very small number) and treating it as the "gospel".

A broader base tends to provide considerably better guidance when you encounter something entirely new and different.

Jerry Coffin
A: 

I recommend taking a look at U++

http://www.ultimatepp.org/

and their examples which deal with File I/O, database, graphics, SDL, network, etc and user interface of course.

http://www.ultimatepp.org/www$uppweb$examples$en-us.html

The nice thing is you can view/read most of everything including the source code on your browsers first without having to download, install, compile or commit to that framework. In this way, it's less boring than taking a large program and find your way through all of that code base from the very beginning. Eventually you might still have to do that, but this approach can build up your momentum quickly.

Khnle
A: 

If you have interest in desktop applications then start with some KDE project of your interest like KDevelop, KStarts, marble, digicam, konqueror etc. KDE has its long array of projects and strong techbase so you can read documentations, Techbase article of respective project or you can have discussion with developer on kde-devel mailing list and #kde-devel Irc.

GG
A: 

I would not attempt to learn from project code at all. The code you are looking at is unlikely to have been written intentionally as an exemplar of good practice, and is also likely to comprise good code and code that given the time, the author would rather re-factor.

Without knowing the history of a project and the design decisions that led it to be that way, you are unlikely to learn much of use for anything non-trivial, and it is unlikely that you will find a project where such decisions are documented, unless the intent of the project were specifically as a teaching artefact, and for that the best source would be books from respected authors. These will teach you techniques from first principles that you can apply generally to your own work, without the noise, baggage, compromise, and even politics that comes with most real world development.

This for example might be a good place to start (and other books in the series not in this set).

Clifford