This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources. Find sources: "Snake case" – news ·newspapers ·books ·scholar ·JSTOR(August 2015) (Learn how and when to remove this message) |

Snake case (sometimes stylizedautologically assnake_case) is thenaming convention in which each space is replaced with anunderscore (_) character, and words are written inall lower case. It is a commonly used naming convention incomputing, for example forvariable andsubroutine names, and forfilenames. One study has found that readers can recognize snake case values more quickly thancamel case. However, "subjects were trained mainly in the underscore style", so the possibility of bias cannot be eliminated.[1]
A variation isscreaming snake case, where words are written inall caps (stylized as SCREAMING_SNAKE_CASE).[2] This convention is used forconstants in programming languages likeC/C++,Python,Java,PHP, as well as forenvironment variables.
The use of underscores as word separators dates back to the late 1960s. It is particularly associated withC, is found inThe C Programming Language (1978), and contrasted with pascal case (a type ofcamel case). However, the convention traditionally had no specific name: thePython programming language style guide refers to it simply as "lower_case_with_underscores".[3]
WithinUsenet the term snake_case was first seen in theRuby community in 2004,[4] used by Gavin Kistner, writing:
BTW...what *do* you call that naming style? snake_case? That's what I'll call it until someone corrects me.
As of 2015[update], names for other delimiter-separatednaming conventions for multiple-word identifiers have not been standardized, although some terms have increasing levels of usage, such as lisp-case, kebab-case, SCREAMING_SNAKE_CASE, and more.[5][6][7]
The following programming languages use snake case by convention: