version 1.1, 2001/06/16 15:59:44
|
version 1.6, 2001/12/13 14:53:20
|
|
|
|
(Preliminary; still need to be modified and voted on). |
| |
Development Conventions | Development Conventions |
======================= | ======================= |
| |
1. Indent by increments of four. |
1. Indent by increments of four (tabsize of 8). |
| |
2. Use "char* x" rather than "char *x". | 2. Use "char* x" rather than "char *x". |
| |
|
|
platform. | platform. |
| |
22. No binaries may be committed to repository. | 22. No binaries may be committed to repository. |
|
|
|
24. Don't separate return type onto its own line: |
|
|
|
Avoid this: |
|
|
|
int |
|
f() |
|
{ |
|
} |
|
|
|
|
|
25. All code must be reachable (built) from master makefile. Otherwise |
|
it will not be reached when doing mass substitutions, testings of |
|
builds, and license changes. |
|
|
|
26. Prepend '_' to private members (including methods). |
|
|
|
27. Use /** */ rather than /// for DOC++. |
|
|
|
29. Always write a regression test for everything. |
|
|
|
30. Always build and run all regression tests before committing. |
|
|
|
31. Be mindful that the tests must run on all supported platforms and |
|
that a commit may break another platform. |
|
|
|
33. Tests must clean up the effect they have on the repository. |
|
|
|
34. Avoid use of condiational compilation for obscuring platrform |
|
differences. Use (or put) routines in appropriate platform files |
|
or in the System*.cpp files in Common. |
|
|
|
-------------------------------------------------------------------------------- |
|
|
|
34. Use this comment style for DOC++ comments: |
|
|
|
class X |
|
{ |
|
public: |
|
|
|
/** Creates widgets. |
|
@param numWidgets the number of widgets to create. |
|
@return true on success. |
|
*/ |
|
void createWidgets(Uint32 numWidgets); |
|
}; |
|
|
|
35. Never use full quotes in includes in header files. Use the angle brackets |
|
and hence use the fully qualified path. |
|
|
|
#include <Pegasus/MyModule/Erp.h> |
|
|
|
Not |
|
|
|
#include "Erp.h" |
|
|
|
34. Explain use of Linkage.h files |
|
|
|
35. Don't use ultostr(), use sprintf(). |
|
|
|
36. main() must return something (for NT). |
|
|
|
37. Don't use this construct: |
|
|
|
void f() throw TooBad; |
|
|
|
Not supported on many platforms. |