Home

Snakecase

Snake_case is a naming convention in which all letters are lowercase and spaces are replaced by underscores to separate words. A typical example is user_id or parse_input. The style avoids spaces and capitalization, relying on underscores to delineate boundaries. In many guidelines, identifiers should not start with a digit, and consecutive underscores are discouraged unless they have a specific meaning. ASCII letters are normally used, with non-Latin characters generally avoided in core identifiers.

Snake_case is widely used in languages and ecosystems such as Python, Ruby, Rust, and in many configuration

Examples: parse_input, user_id, get_elapsed_time. For constants, some projects use SCREAMING_SNAKE_CASE (all caps with underscores).

Advantages include readability and compatibility with ASCII. Disadvantages include longer identifiers and potential conflicts with language

Historically, snake_case gained prominence in Python and Ruby and has since become a common default in several

files
and
database
schemas.
It
is
often
preferred
for
variables,
function
names,
and
file
names.
By
contrast,
other
naming
schemes
include
camelCase
or
PascalCase,
where
capitalization
indicates
word
boundaries,
and
kebab-case,
which
uses
hyphens
and
is
common
in
URLs
and
some
file
names.
rules
about
digits
or
underscores.
There
are
tools
to
convert
between
conventions
and
linters
that
enforce
style.
languages.
It
remains
a
standard
choice
for
codebases
and
configuration
alike
when
lowercase
with
underscores
is
preferred.