Identifier Prefix

A common feature of naming conventions is to use common prefixes when creating names. The prefix can be used to indicate data type, component name, scope, namespace, copyright holder, or other aspects associated with the identifier.

HungarianNotation and UncleBobsNamingConventions are examples.

Some programming languages use the prefix as a mechanism for determining namespaces, visibility, etc.

Pros Cons

On alphabetic ordering

If your tools aren't smart, alphabetic ordering can be a drawback. From the InterfaceHallOfShame:

One of the features of PowerBuilder is that it allows the user to specify his or her own events, based on operating system messages. These messages are presented to the developer through a list, from which he or she selects the message of interest. The drawback is that there are hundreds of messages, each of which PowerBuilder unnecessarily attaches its own "pbm_" prefix to. Because of this prefix, the user cannot jump through the list by pressing the first character of the desired message, but instead, must physically scroll through the list using the scroll bar. The user ends up wasting a great deal of time searching through the list, when a few keystrokes could have made the process much more efficient.

An IdentifierPrefix is particularly useful when included as an organizing concept for components within a SystemOfNames.

CategoryNaming CategoryCodingIssues

View edit of November 4, 2014 or FindPage with title or text search