next up previous contents index
Next: Utility Classes Up: Implementation in C++ Previous: Implementation in C++

Naming Conventions

Naming conventions of identifiers for classes, functions, variables, etc. are not only clues to the compiler but also expressive hints to the programmer. An identifier can express various aspects of the object with the name.

Naming conventions greatly affects the usability and maintainability of programs, namely, their quality.

In the implementation, naming conventions conform mostly to those of the Java language, which are very descriptive and friendly. The conventions are summarized as follows:

Identifiers
are concatenations of words which are descriptive of their types, functions, roles, etc.
The first letter of concatenated words
is capitalized.
The first letter of an identifier
is capitalized only when it is a class or a type.
Accessors
take one of these forms: isWhat(), getSomething(), setSomething(), clearSomething().

For example, a class may have the name of PersistentPointer. An accessor may have the name of isGrabbed. Names which can be interpreted as pseudo-English expressions will be helpful.



Mori Tetsuya / t2y3141592@gmail.com