117 | | * In C++, the null pointer value should be written as 0. In C it should be written as NULL. In Objective-C, it should be written as nil if it is being used as a null pointer of type id or another ObjC object type, otherwise NULL. |
118 | | |
119 | | * True and false values of type bool (common in C and C++), or just generic true/false values, should be written as true and false. Values of the Objective-C BOOL type should be written as YES and NO. |
| 116 | * In C++, the null pointer value should be written as `0`. In C it should be written as `NULL`. In Objective-C, it should be written as `nil` if it is being used as a null pointer of type `id` or another Objective-C object type, otherwise `NULL`. |
| 117 | |
| 118 | * True and false values of type `bool` (common in C and C++), or generic true/false values, should be written as `true` and `false`. Values of the Objective-C `BOOL` type should be written as `YES` and `NO`. |
218 | | * Free function names in C++ should follow the same naming conventions as local variables. Most functions should be named to sound like verb phrases, like “openDoor” or “walkAroundTheBlock”. (getters, setters, predicates?) |
219 | | |
220 | | * C++ data members should be named like local variables, but with a prefix of m_. |
| 217 | * Free function names in C++ should follow the same naming conventions as local variables. Most functions should be named to sound like verb phrases, like `openDoor` or `walkAroundTheBlock`. (getters, setters, predicates?) |
| 218 | |
| 219 | * C++ data members should be named like local variables, but with a prefix of `m_`. |
228 | | * Enum members should user InterCaps with an initial capital letter. |
229 | | |
230 | | * #defined constants should use all uppercase names with words separated by underscores. |
231 | | |
232 | | * Macros that expand to function calls or other non-constant computation: these should be named like functions, and should have parentheses at the end, even if they take no arguments (with the exception of some special macros like ASSERT). Note that usually it is preferrable to use an inline function in such cases instead of a macro. |
| 227 | * Enum members should user !InterCaps with an initial capital letter. |
| 228 | |
| 229 | * `#define`d constants should use all uppercase names with words separated by underscores. |
| 230 | |
| 231 | * Macros that expand to function calls or other non-constant computation: these should be named like functions, and should have parentheses at the end, even if they take no arguments (with the exception of some special macros like `ASSERT`). Note that usually it is preferrable to use an inline function in such cases instead of a macro. |
325 | | * All files must #include "config.h" first. |
326 | | |
327 | | * All files must #include the primary header second, just after "config.h". So for example, Node.cpp should include Node.h first, before other files. This guarantees that each header's completeness is tested, to make sure it can be compiled without requiring any other header files be included first. |
328 | | |
329 | | * Other #include statements should be in sorted order (case sensitive, as done by the command-line sort tool or the Xcode sort selection command). Don't bother to organize them in a logical order. |
| 324 | * All files must `#include "config.h"` first. |
| 325 | |
| 326 | * All files must `#include` the primary header second, just after `"config.h"`. So for example, `Node.cpp` should include `Node.h` first, before other files. This guarantees that each header's completeness is tested, to make sure it can be compiled without requiring any other header files be included first. |
| 327 | |
| 328 | * Other `#include` statements should be in sorted order (case sensitive, as done by the command-line sort tool or the Xcode sort selection command). Don't bother to organize them in a logical order. |