Changeset 103 for trunk/CodingConventions.txt
- Timestamp:
- Aug 29, 2001, 8:52:22 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CodingConventions.txt
r31 r103 30 30 as outlined below. 31 31 32 3. For all variables, use the usual OS/2 type prefixes. 32 3. Brackets style: 33 34 if (condition) 35 { 36 // do this 37 } 38 else 39 { 40 // do that 41 } 42 43 You may leave out brackets if there's only one statement 44 after if or else, of course, but with nested if statements, 45 I usually add them even in that case since it's so easy 46 to mismatch the nesting then. 47 48 4. switch/case style: 49 50 switch (msg) 51 { 52 case WM_CREATE: 53 // code 54 break; 55 56 case WM_DESTROY: 57 // code 58 break; 59 } 60 61 5. For all variables, use the usual OS/2 type prefixes. 33 62 Here are some: 34 63 … … 52 81 For pointers, prefix "p" (e.g. USHORT *pausThings[3]). 53 82 54 4. Prefix C++ class member variables with an underscore ("_").83 6. Prefix C++ class member variables with an underscore ("_"). 55 84 This allows people who are not familiar with the class 56 85 interface to identify member variables easily. Also, this … … 58 87 variables. 59 88 60 5. Prefix global variables with "G_" for the same reason.89 7. Prefix global variables with "G_" for the same reason. 61 90 Global variables are potentially dangerous, so these 62 91 can be more easily identified. 63 92 64 6. Comment your functions in xdoc-style. See any function93 8. Comment your functions in xdoc-style. See any function 65 94 in the sources for how this can be done. Basically, use 66 95 /* */-style comments before the function header and … … 94 123 to the CVS server. 95 124 96 7. When changing code, mark the code as changed in the125 9. When changing code, mark the code as changed in the 97 126 xdoc comment by using something like the following: 98 127 … … 117 146 version. 118 147 119 8.When adding a new function, use the same, just use @@added148 10. When adding a new function, use the same, just use @@added 120 149 instead of @@changed. 121 150
Note:
See TracChangeset
for help on using the changeset viewer.