17.4.1 Naming Conventions

The basic tension in naming something is the length vs. descriptiveness tradeoff. In general, we try to avoid abbreviations, but really long words like "environment" inevitably get shortened to "Env", etc.

The bulk of the conventions we have established have to do with distinguishing between different categories of names: class type names, member function names, and member names being the major categories. In addition, the way in which names composed of multiple words are formed is discussed.

17.5 Object Class Names

Class types are first-letter-capitalized with words separated by capitalization: e.g. MyClass. There are certain exceptions, where an underbar '_' is used to attach a high-frequency suffix, usually from a template, to the name:

Common Suffixes:

_List
taList derivative.
_Group
taGroup derivative.
_MGroup
MenuGroup derivative.
_Array
taArray derivative.
_SPtr
Smart Spec object pointer (PDP++).

Also if the class name contains multiple words, words which are actually acronyms ending with a capital letter are separated from the following word by an '_', e.g., (CE_Stat).

Classes in lower-level libraries also have the name-space identifier prefixed to the name, which is lower case: e.g., ta, taiv, css.

17.6 Enums

enum type names follow the same naming convention as class types. enum members are all upper-case, words are separated by '_', e.g., INIT_STATE.

17.7 Member Names

Members are lower-case, words are separated by a '_', e.g., member_name. One exception is for names ending in spec or specs in which case there is no separation (e.g., viewspecs).

17.8 Method Names

Methods are first-letter-capitalized, words are separated by capitalization (e.g., RunThis()). However, there some special prefixes and suffixes that are exceptions to this rule, because they are "high frequency" and denote a whole class of methods:

Prefixes:

Dump_
Saving and loading functions.
Compute_
Network computation functions (PDP++).
Send_
Network communication functions (PDP++).
C_
C code versions of process functions (PDP++).
Init_
Special initialize function for processes (PDP++).

Suffixes:

_impl
Implementation (guts) of some other function which is the one that should be called by the user.
_xxxx
Other _impl type functions that do specific aspects of the implementation (xxx is lower case). Examples in PDP++ include _flag, _force.
_
(just a trailing underbar) This is a short version of _impl, which is used extensively in InterViews, and sparingly in TA/PDP++.
_post
A function which is to be called after another one of the same name (for two-step processes).
_Copy
A function called after the Copy function (e.g., to clean up pointers).
_gui
A special GUI version of function call.
_mc
A special menu callback version of function call.