||This article possibly contains original research. (October 2014)|
Snake case (or snake_case) is the practice of writing compound words or phrases in which the elements are separated with one underscore character (_) and no spaces, with each element's initial letter usually lowercased within the compound and the first letter either upper or lower case—as in "foo_bar", "hello_world". It is commonly used in computer code for variable names, and function names, and sometimes computer filenames. At least one study found that readers can recognize snake case values more quickly than CamelCase.
When each word is delimited by a hyphen instead of an underscore, the practice is popularly known as kebab-case or lisp-case; also, the uppercased initial word character variant is known as Train-Case, and the all lowercased variant is known as spinal-case. Screaming snake case is similar to snake_case, with letters written in UPPERCASE, as in: THIS_IS_AN_EXAMPLE.
Languages that use snake case as convention
- OCaml for variable and function names
- Erlang, for function names
- Python, for variable names, function names, and method names
- Rust, for variable and function names