49.4.1Case-based naming styles¶
Table 1:Case-based naming styles
Naming style | Description | Used for | Examples |
|---|---|---|---|
| All uppercase letters with words separated by underscores ( | Global constants, environment variables, and configuration flags across C, Java, Rust, and Python. |
|
| Capitalized words separated by hyphens ( | HTTP headers and specialized configuration keys. |
|
| First word starts with a lowercase letter; every subsequent word starts with an uppercase letter with no spaces or symbols. | Variables, functions, and methods in Java and C#. |
|
| Every word—including the first word—starts with an uppercase letter. | Classes, structures, interfaces, enums, and constructors across C#, Java, Rust and Python. |
|
| All lowercase letters with words separated by underscores ( | Variables and functions in Python, Ruby, Rust and PHP. |
|
| All lowercase letters with words separated by hyphens ( | CSS class/ID names, URLs, HTML attributes, and file/folder names. |
|
49.4.2Semantic styles¶
Table 2:Semantic styles
Naming style | Description | Examples |
|---|---|---|
Hungarian notation | Prefixes an identifier with a short code indicating its data type or intended purpose. |
|
Interface & type prefixes | Prefixing interface names with an |
|
Boolean prefixes | Prefixing boolean variables or predicate functions with words
like |
|
Action-based function patterns | Prefixing function names using a set of verb patterns like
|
|
Unit suffixes | Appending measurement units to variable names to prevent ambiguity. |
|