SkillAgentSearch skills...

NamingThings

Content on tips, tricks, advice, practices for naming things in in software/technology

Install / Use

/learn @peteraritchie/NamingThings

README

01-17-23 UPDATE: Added THAT 2023 Slides
01-12-23 UPDATE: Added CodeMash 2023 Slides
10-3-22 UPDATE: Added Prairie Dev Con 2022 Regina Slides
8-8-22 UPDATE: Added KCDC 2022 Slides
3-11-21 UPDATE: Added example of [organizational guidance][Organizational Guidelines]
10-17-19 UPDATE: Techcon '19 version of the slides are now available

Naming Things

Content (TL;DR) on tips, tricks, advice, practices for naming things in software/technology

Drivers

Naming guidance like .NET Framework Guidelines are helpful, but they only help in minor situations and don't do a lot to help solve the naming things problem in software.

Vision

Detail research results around where some of the pain points in naming are, analyze potential solutions and provide guidance for making naming things easier.

Guiding Principles

  • There are always exceptions; we can only mitigate their effect
  • Purposefulness This means doing this "on purpose", or by design.
  • Consistency Enough said
  • Least Astonishment Building on consistency, where consistency of intuitiveness is essential.

Scope

These guidelines focus on wording and less on capitalization. "Casing" is important, but that is a separate, independent style.

Detailed Guidance

Definitions

<dl> <dt><a name="countable-noun">countable noun</a></dt><dd>

/ˈkoun(t)əb(ə)l/
adjective
    a noun that can form a plural or be used with the indefinite article.

Antonyms: uncountable noun

</dd> <dt><a name="mass-noun">mass noun</a></dt><dd>

/ˈmas ˌnoun/
noun
    a noun that is usually uncountable but can be made plural or used with a or an when you are talking about different types of something.
    For example, "breads" is used as a mass noun in the shop sells several different breads.

</dd> <dt><a name="uncountable-noun">uncountable noun</a></dt><dd>

/ˌənˈkoun(t)əb(ə)l noun/
adjective
    a noun that cannot form a plural or be used with the indefinite article.

</dd> <dt><a name="collective-noun">collective noun</a></dt><dd>

/kəˈlektiv noun/
noun
    a singular noun, such as "committee" or "team" refers to a group of people, animals, or things. [In American English it must be used with a singular verb]

</dd> <dt><a name="deverbal">deverbal</a></dt><dd><span> /ˌdēˈvərb(ə)l/

adjective
    (of a noun or adjective) derived from a verb but behaves strictly as a noun or adjective and not a verb.

noun
   a deverbal noun or adjective.</span>

See also: verbal noun

</dd> <dt><a name="action-noun">action noun</a></dt><dd>

/ˈakSH(ə)n noun/
noun
    A noun expressing action.

synonyms:
    noun of action

</dd> <dt><a name="verbal-noun">verbal noun</a></dt><dd>

/ˈvərbəl noun/
noun
    A that is noun formed as an inflection of a verb and partly sharing its constructions[/forms. i.e., sometimes behave as a verb].

"Verbal nouns contrast with deverbal nouns, that is, other kinds of nouns derived from verbs, such as attempt, destruction, and including nouns ending in -ing that do not have verbal force: building in The building was empty. They also contrast with the gerund, which also ends in -ing, but is syntactically a verb."

See also: deverbal

</dd> <dt><a name="zero-derivation-words">zero-derivation words</a></dt><dd>

noun
    A process of word-formation in which there is no change to the form that undergoes it.
    e.g., that by which the verb fish, seen as one lexical unit, is derived from the noun fish, seen as another lexical unit.

Synonyms: zero-affixation words.

</dd> <dt><a name="metonym">metonym</a></dt><dd>

/ˈmedəˌnim/ noun     a word, name, or expression used as a substitute for something else with which it is closely associated.
    For example, Washington is a metonym for the federal government of the US.

</dd> <dt><a name="homograph">homograph</a></dt><dd>

/ˈhäməˌnim,ˈhōməˌnim/ noun     each of two or more words spelled the same (homonym) but not
    pronounced the same and have different meanings and origins.
    Homonym is a type of homograph.

</dd> </dl>

Prefer English Language Grammar Conventions

Ordering of Adjectives in Noun Phrases

English grammar order adjectives by relation, in the following order preceding the noun: 1) opinion, 2) size, 3) physical quality, 4) shape, 5) age, 6) color, 7) origin, 8) material, 9) type, 10) purpose. Examples:

  • strange, green, metallic material (1, 6, 8)
  • long, narrow, plastic brush (2, 4, 8)
  • round, Italian, bread-like Christmas cake (4, 7, 9)
  • beautiful, tall, thin, young, black-haired, Scottish person (1, 2, 3, 4, 5, 6, 7)
  • amazing, little, old, Chinese cup and saucer (1, 2, 5, 7)

Principles

Compartmentalization Compartmentalize things that can be reasoned about independently of other things; these are the things that require unique names. One thing that makes naming hard is naming things that have no unique attributes or behavior.

Namespaces

Namespaces suit a couple of needs, both relating to the grouping of types. Grouping types within a namespace should be based on the functionality implemented by those types.

Use a pluralized noun or noun phrase for namespaces that group types related by interface A namespace that contains types related by interface should be named with a pluralized noun. One is a grouping of types that implement a specific interface. A Collections suffix signifies the namespace contains types that implement interfaces that allow types to act like collections.

Use a mass deverbal noun or noun phrase for namespaces that group types related by functionality (but different). The other grouping can cause some consternation because the grouping can easily feel subjective. You can also group types by functional usage. This type of grouping can be thought of as capability grouping. In which case, the namespace name can be a noun of action or a noun based on a verb. The suffixes "-ion" and "-ing" come into play here. e.g., Processing or Administration.

Use countable nouns or pluralized adjectives for namespaces that classify other namespaces <code>System.<i>Diagnostics</i>.Tracing</code>

Use adjectives or mass nouns to sub-group types related by interface <code>System.Collections.<i>Generic</i></code>, <code>System.ComponentModel.<i>Composition</i></code>.

Being successful: Perform grouping on purpose, only group types with similar attributes or similar behavior (randomly grouping types within a namespace is very subjective, and thus a good name for it is subjective). Prefer nouns that describe an act or a responsibility. Avoid ending in "-ion", avoid words ending in "-tion" or "-sion. A "mass noun" is also called a noncountable noun. Avoid words that function as mass deverbal nouns but often also function as adjectives (need example).

Summary

Namespace names should signify how the types in the namespaces are grouped.

See also General

Assemblies; Class Libraries and Programs

Assemblies are the deployable binary groupings of compiled code. As such, the context of these binaries is generally the file system or URIs. Assemblies often travel in packages and thus have unique constraints that affect naming. Assembly names can be scoped by directory, but that depends on deployment and choices outside of your control (names of 3<sup>rd</sup> party assemblies and packages).

Classes

Prefer Common nouns A common noun is a noun that isn't a proper noun: they are names for general things rather than names that identify specific things.

Being Successful Avoid plural, mass, and collective nouns; as well as words that act as nouns and other parts of speech.

See also General

Value Types

Avoid deverbal nouns or noun phrases for value types (nouns derived from verbs, e.g., words suffixed with -or, -ant, -ar -ian, -er, etc.)

See also General

Structs

Structs often function as value types; avoid deverbal nouns or noun phrases for structs (nouns derived from verbs, e.g., words suffixed with -or, -ant, -ian, -er, etc.)

See also General

Interfaces

Prefer Adjectives Formed From Verbs Adjectives describe attributes of something, like abilities. Not all adjectives describe abilities, but as an interface is a representation of an ability, the name s

View on GitHub
GitHub Stars45
CategoryDesign
Updated2mo ago
Forks5

Security Score

95/100

Audited on Jan 25, 2026

No findings