C plus plus version
From WikiManual
I propose we discuss the C++ design and coding standards in here. A wiki is much handier then a forum or PM's for it.
Original document by Taldor, comments by Numsgil in Red
C++ design
General concepts
- Class based approach. In some cases, procedural in others. It's a value decision I'll make as I port the code.
- Portable code. Where possible. Preferably in house or free library wrappers for non portable functions, such as multithreading and OS timers.
Structure
See the present VB code
- Main
- Engine
- User Interface
- Darwin (the simulation engine)
- Veg
- Tie
- Robot
- Sense
- Engine
To be used everywhere:
- Vector_4 (using uBLAS) Present vector class is from this article. I'll use whichever is fastest, feel free to perfrom benchamrks
- Matrix_4 (also using uBLAS) See above
- Random (using 'srand()' and 'rand()') See the chapter on random numbers
- Object (the base class) Depends on the class
C++ coding standards
I would use:
- C++ C++ libraries where such libraries do what I want them to do, C libraries otherwise. Another value decision.
- Four spaced tabs - Aye.
- External librairies when possible (ie. Boost) Internal libraries where possible, to decrease the number of code dependancies, except where external libraries perform the job faster/more comoprehensively than internal libraries can.
- SDL Dunno, haven't looked into graphics libraries yet.
- ...