1 (Preliminary; still need to be modified and voted on).
3 Development Conventions
4 =======================
6 1. Indent by increments of four (tabsize of 8).
8 2. Use "char* x" rather than "char *x".
10 3. Put opening brace on a line by itself.
12 4. ThisIsAClassName - no underscores.
14 5. thisIsAMethodName() - no underscores.
16 6. Lines should not span more than 80 columns.
18 7. When methods span more than 80 columns, do this:
20 void MyClass::myMethod(
21 const char* someReallyLongName,
22 const char* someOtherReallyLongName);
24 8. Use const whenever possible.
26 9. Use const methods whenever possible.
28 10. Braces must be aligned with control keyword:
40 11. No spaces after names:
42 Not "void f ()" but "void f()".
46 callingMyFunction(blah,
62 14. Use 0 and not NULL.
64 15. Don't commit anything that breaks the build (try a clean slate
67 16. Files should take advantage of case and avoid underscores.
68 Files should have the same name as the class (and same case).
70 17. Separate functions with blank lines.
81 18. No warnings should be committed.
83 19. Test big changes on at least Windows and Unix (or Linux)
85 20. Move SLP out of Common.
87 21. Changes must work on all platforms. Commits must not break any
90 22. No binaries may be committed to repository.
92 24. Don't separate return type onto its own line:
102 25. All code must be reachable (built) from master makefile. Otherwise
103 it will not be reached when doing mass substitutions, testings of
104 builds, and license changes.
106 26. Prepend '_' to private members (including methods).
108 27. Use /** */ rather than /// for DOC++.
110 29. Always write a regression test for everything.
112 30. Always build and run all regression tests before committing.
114 31. Be mindful that the tests must run on all supported platforms and
115 that a commit may break another platform.
117 33. Tests must clean up the effect they have on the repository.
119 34. Avoid use of condiational compilation for obscuring platrform
120 differences. Use (or put) routines in appropriate platform files
121 or in the System*.cpp files in Common.
123 --------------------------------------------------------------------------------
125 34. Use this comment style for DOC++ comments:
132 @param numWidgets the number of widgets to create.
133 @return true on success.
135 void createWidgets(Uint32 numWidgets);
138 35. Never use full quotes in includes in header files. Use the angle brackets
139 and hence use the fully qualified path.
141 #include <Pegasus/MyModule/Erp.h>
147 34. Explain use of Linkage.h files
149 35. Don't use ultostr(), use sprintf().
151 36. main() must return something (for NT).