Letter cases reminder
With this post, I would like to clarify something that we use every day when we name files, folders, emails, etc. The Letter Cases. Letter case (or just case) is the distinction between the letters that are in larger uppercase or capitals and smaller lowercase in the written representation of certain languages. In computer programming are a set of rules to be used for identifiers. That denote variables, types, functions, files, directories, and other entities.
Most popular letter cases
| Case | Example | Description |
|---|---|---|
| Flat case | - lettercase - flatcase |
Spaces and punctuation are removed and all the letters are lowercase. |
| Camel case | - letterCase - camelCase |
Spaces and punctuation are removed and the first letter of each word after the first one is capitalized. |
| Pascal case | - LetterCase - PascalCase |
Spaces and punctuation are removed and the first letter of each word after the first one is capitalized. |
| Snake case | - letter_case - snake_case |
Punctuation is removed and spaces are replaced by single underscores. Normally the letters share the same case. |
| Kebab case | - letter-case - kebab-case |
Similar to snake case, except hyphens rather than underscores are used to replace spaces. |
| Doner case | - letter|case - doner|case |
Punctuation is removed and spaces are replaced by pipes. Very common as an OR symbol. |
| Train case | - Letter-Case - Train-Case |
Like the kebab case but every word is capitalized. |
| Upper flat case | - LETTERCASE - UPPERFLATCASE |
Spaces and punctuation are removed and all the letters are capitalized. |
| Macro case | - LETTER_CASE - MACRO_CASE |
Spaces and punctuation are replaced by single underscores, and all letters are capitalized. |
| Cobol case | - LETTER-CASE - COBOL-CASE |
Spaces and punctuation are replaced by hyphens and all letters are capitalized. |
| Studly caps | - LeTTeRCaSe - stUdLYcApS |
Mixed case with no significance to the use of the capitals. Sometimes only vowels are upper case, but often it is simply random. |
My favorite letter case
PascalCase + snake_case
A mix between Pascal case and Snake case make the best combination for my daily tasks (coding, naming files, naming conventions for systems, etc.) The great advantage of using this mix allows the creation of multiple hierarchies in the same string.
For example, you can create a naming convention using underscores for each level and Capitals two distinguish between words.
| Structure | Index_FirstLevel_SecondLevel |
|---|---|
| Example | 01_ProjectName_TaskName |
Main letter cases
Flat case
Example lettercase
Spaces and punctuation are removed, and all letters are lowercase. This format is straightforward, with no capitalization or special characters, making it useful for simple, uniform naming conventions. Commonly used in contexts where minimalism and simplicity are key, such as in certain coding environments or database fields.
Camel case or Dromedary case
Example letterCase
Spaces and punctuation are removed and the first letter of each word is capitalised. When the first letter of the first word is lowercase ("iPod", "eBay"...), the case is usually known as lower camel case or dromedary case (illustratively: dromedaryCase). This format has become popular in the branding of information technology products and services.
Pascal case
Example LetterCase
Spaces and punctuation are removed and the first letter of each word after the first one is capitalised. If this includes the first letter of the first word, the case is sometimes called upper camel case (or, illustratively, CamelCase), Pascal case, or bumpy case.
Snake case
Example letter_case
Punctuation is removed and spaces are replaced by single underscores. Normally the letters share the same case (e.g. "UPPER_CASE_EMBEDDED_UNDERSCORE" or "lower_case_embedded_underscore") but the case can be mixed, as in OCaml modules. The style may also be called pothole case, especially in Python programming, in which this convention is often used for naming variables. Illustratively, it may be rendered snake_case, pothole_case, etc.
Kebab case
Example letter-case
Similar to snake case, above, except hyphens rather than underscores are used to replace spaces. It is also known as spinal case, param case, Lisp case, and dash case (or illustratively as kebab-case). If every word is capitalised, the style is known as train case (TRAIN-CASE)
Doner case
Example letter|case
Spaces and punctuation are removed and replaced by pipes (|). This case is often used to denote alternatives or to visually separate words in a manner similar to an OR symbol. It provides a unique and less common alternative to other delimiter-based cases, offering a clear visual distinction in contexts where options or separations need to be highlighted.
Train case
Example Letter-Case
A mix between Camel case and Kebab case. spaces are replaced by single hyphens, punctuation are removed and the first letter of each word is capitalised.
Upper flat case
Example LETTERCASE
Spaces and punctuation are removed, and all letters are capitalized. This format is bold and prominent, often used in scenarios where emphasis and visibility are crucial, such as in acronyms or constant values in programming. It is similar to flat case but with the added impact of uppercase letters, making it stand out more in textual content.
Macro case
Example LETTER_CASE
Punctuation is removed, all the letters are capitalised and spaces are replaced by single underscores. It may be referred to as screaming snake case (or SCREAMING_SNAKE_CASE) or hazard case.
Cobol case
Example LETTER-CASE
Punctuation is removed, every word is capitalised and spaces are replaced by single hyphens. Named from the COBOL programming language. COBOL is primarily used in business, finance, and administrative systems for companies and governments.
Studly caps
Example LeTTeR CaSe
Mixed case with no semantic or syntactic significance to the use of the capitals. Sometimes only vowels are upper case, at other times upper and lower case are alternated, but often it is simply random. The name comes from the sarcastic or ironic implication that it was used in an attempt by the writer to convey their own coolness. It is also used to mock the violation of standard English case conventions by marketers in the naming of computer software packages, even when there is no technical requirement to do so – e.g., Sun Microsystems' naming of a windowing system NeWS. Illustrative naming of the style is, naturally, random: stUdlY cAps, StUdLy CaPs, etc.
