How to effectively design a C++ modular program? How to learn?
+1
A:
Here's a ton of books especially about that - http://www.aristeia.com/books.html
Kornel Kisielewicz
2010-06-03 07:31:56
+1
A:
About the only answers to that kind of question that can even hope to fit in an answer here would be advice on books to read.
Jerry Coffin
2010-06-03 07:33:20
...and look at this: http://stackoverflow.com/questions/1860796/your-thoughts-on-large-scale-c-software-design
mlvljr
2010-06-13 15:52:10
+1
A:
For a beginner, you may want to take the "brute force" process:
1. Write a simple main
function in one file.
2. Add some functionality, compile then test.
3. Refactor (use this keyword in Google).
Here are some guidelines for refactoring (not all of them may apply at the same time):
- Repetitive functionality should be separated into another function.
- Repetitive functions should be put into a separate source file and shared.
- Code and data structures that share a common theme should be placed into a single module.
- Classes that share common methods and functions should inherit from a base class containing those common methods and functions.
- Use libraries to contain classes and functions of a common theme.
An alternative is to design a program into functional blocks and data structures. Repeat until the blocks and classes are simple enough for a non-programmer to understand. Then start implementing. Test Driven Development is a good process to use.
Thomas Matthews
2010-06-03 19:15:32