473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Good software using c++ for learning how c++ works

I was wondering if anybody knew any open source software which has
source code that is well documented and written in c++ that I could use
to learn from.

I want to learn more about how programs are built and I thought one
good way is by example.

Jul 24 '06 #1
4 1339
twoeyedhuman1111 wrote:
>I was wondering if anybody knew any open source software which has
source code that is well documented and written in c++ that I could use
to learn from.

I want to learn more about how programs are built and I thought one
good way is by example.
This sample is short on documentation, but it is then exemplary C++ style:

http://sourceforge.net/projects/unittest-cpp/

Download it, build it, and run it. Then read the folder src/tests. You will
find samples like this:

TEST(ArrayCloseSucceeds)
{
float const a1[] = {1, 2, 3};
float const a2[] = {1, 2.01f, 3};
CHECK_ARRAY_CLOSE (a1, a2, 3, 0.1f);
}

That's a unit test case that documents part of the UnitTest++ project. It
shows how CHECK_ARRAY_CLOSE() works.

There are those who claim that unit tests are the best documentation. Your
college professor has doubtless told you this.

Here's a slightly more complex test:

TEST (StreamingMultipleTimesConcatenatesResult)
{
MemoryOutStream stream;
stream << "Bork" << "Foo" << "Bar";
CHECK_EQUAL ("BorkFooBar", stream.GetText());
}

It shows that MemoryOutStream behaves like std::ostringstream. (On some
platforms, they will indeed be the same class.)

Studying this code will show you how a balanced C++ program can distribute
its behavior into minimal and useful classes.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 24 '06 #2

twoeyedhuman1111 wrote:
I was wondering if anybody knew any open source software which has
source code that is well documented and written in c++ that I could use
to learn from.

I want to learn more about how programs are built and I thought one
good way is by example.
I would say take a look at JUCE.
www.rawmaterialsoftware.com/juce
Its Cross-platform and uses nearly all the design patterns, I know.

Jul 24 '06 #3
Phlip posted:
There are those who claim that unit tests are the best documentation.
Your college professor has doubtless told you this.

I find that the self-taught programmers are far more proficient than the
college students -- probably because they took up programming as a hobby long
before they ever attended college.

--

Frederick Gotham
Jul 24 '06 #4

Frederick Gotham wrote:
Phlip posted:
There are those who claim that unit tests are the best documentation.
Your college professor has doubtless told you this.


I find that the self-taught programmers are far more proficient than the
college students -- probably because they took up programming as a hobby long
before they ever attended college.

--

Frederick Gotham
Actually, I started trying to teach myself programming in 6th grade and
found it very fun but very difficult. I have tried to make some
different programs which eventually outgrew themselves and became too
complicated for me.

It seems though that there are many programs which I can learn from.
I'm going to read these and then attempt to create another program.
Also, next time, I think I'm going to have to think harder about how
OOP and how I could better use it.

Thank you for showing me Juce, I'll read up on this.

Jul 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: matty | last post by:
Go away for a few days and you miss it all... A few opinions... Programming is a craft more than an art (software engineering, not black magic) and as such, is about writing code that works,...
52
by: Tony Marston | last post by:
Several months ago I started a thread with the title "What is/is not considered to be good OO programming" which started a long and interesting discussion. I have condensed the arguments into a...
2
by: ggg | last post by:
I'm looking for a complete project/application done with heavy use of of object-oriented programming & design. Preferably something well documented and/or commented so that I can pick it apart...
226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
7
by: tada991 | last post by:
Hello Everyone, I just purchased Visual Studio .Net Architect 2003 and want to know what's a good book for begginers to start with. I know nothing about programming whatsoever, but I do have a...
6
by: SR | last post by:
Looking for a Obfuscator that provides advanced Obfuscation like string encryption. Purchasing one is fine. It would be nice to hear from developers what products do the job. The price range...
191
by: Xah Lee | last post by:
Software Needs Philosophers by Steve Yegge, 2006-04-15. Software needs philosophers. This thought has been nagging at me for a year now, and recently it's been growing like a tumor. One...
63
by: John Salerno | last post by:
I know there's a request for a good IDE at least once a week on the ng, but hopefully this question is a little different. I'm looking for suggestions for a good cross-platform text editor (which...
26
by: vlsidesign | last post by:
I am a newbie and going through "The C programming language" by Kernighan & Richie on my own time (I'm not a programmer but I want to learn because it can save me time in my normal job, and it is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.