![]() |
![]() |
![]() |
Quality source code I'm looking for C++ source code that I could learn from. What open-source projects have the best quality source code? Are there any projects that I should avoid looking at? So far I have seen several C programs that had what I think was very good quality source, but there's much less C++ out there. I don't care whether they are linux or windows or OSX programs, as long as I can just read the code and learn.
TomA
What kind of program are you interested in? You'll probably be better able to judge the beauty of the code if you understand the subject matter reasonably well.
K
sweetcode.org
eclectic_echidna
LyX (http://www.lyx.org) has some great C++ code. However, it also has some abominable stuff that's getting pulled out.
Koz
I think there's a lot to be learned from FLTK (many others disagree). Among other things, it puts globals to very good use and simplicity for the end user above all else. [ http://fltk.org ].
Ori Berger
What don't you like about boost?
K
I like FLTK too. The style is very practical/"real world".
Dan Maas
Also KDE (www.kde.org) contains a HUGE amount of C++ code. There are some rough spots, but the core libraries (esp. Qt) are very clean.
Dan Maas
I learned a lot about OO coding from the source of log4cpp. http://log4cpp.sourceforge.net/
ICBW
Thanks very much for all the suggestions. KDE and Qt are great.
TomA
There is also the magnificent ACE Toolkit:
gunga
Joe on Software (Joe)
Whenever I look at boost and similar code, my spider sense, (or is that common sense?) triggers with a "wrong tool for the job" message.
Ori Berger
The point of spirit is to allow grammars to be directly specified in your source code (ideally to make maintaining a program easier). My beef about it is just that it's an LL parser, rather than a general LR parser.
K
Holy cow what a good question. I wish people asked this before they wrote PHP and Perl.
Me
Whether you wanted a book or not, I'm giving you one :). Read Code Complete by Steve McConnel. It's the single most comprehensive guide to writing good code I've seen. "Writing Solid Code" is supposed to be good as well, though I haven't read it.
Chris Kessel
|