String Case

Multiword identifiers require a case to distinguish meaning between words while still remaining a single token. We define the variety of cases, when they are used, and set a standard naming convention.

A simple classification of possible cases is the casing of each word and the character used to join them.

underscore _hyphen -empty delimeter
lowercasesnake_casekebab-caseflatcase
UPPERCASEUPPER_SNAKE_CASECOBOL-CASEUPPERFLATCASE
CapitalizedPascal_Snake_CaseTrain-CasePascalCase

However, this fails to identify cases where an identifier contains words of multiple casings, like camelCase, which contains a lowercase and a capitalized word. We describe two additional patterns: camel, where the first word is lowercase and the rest are capitalized, and sentence, where the first word is capitalized and the rest are lowercase.

underscore _hyphen -empty delimeter
camel Patternunnamed_Caseunnamed-CasecamelCase
Sentence patternBjarne_caseBjarne-bab-caseUnnamedcase

See that these names are either unclassified or perhaps unheard of. Further research is required to determine a practical name. Please reach out if you have evidence of these cases being used in practice, and what it might be called.

One might consider other stylistic ways to print a string, although their use for an identifier is impractical or absurd. This includes the space-delimited cases, some of which are not listed here.

titleTitle Case
alternatingaLtErNaTiNg CaSe
randomranDom CAsE
toggletOGGLE cASE
surreals u r r e a l c a s e

This website is a project to formally define these cases and set naming conventions while siting a history of their usage in computing.