ArticleslgStudy

science

Snake case

Snake case is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Snake case rather than just read about it. In short: Snake case (sometimes stylized autologically as snake_case) is the naming convention in which each space is replaced with an underscore (_) character, and words are written in all lower case. It is a commonly used naming convention in computing, for example for variable and subroutine names, and for filenames.

Snake case — main illustration
Snake case — illustration

Key takeaways

  • Snake case belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Snake case to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Snake case from memory before moving on to harder problems.

Reference excerpt

Snake case (sometimes stylized autologically as snake_case) is the naming convention in which each space is replaced with an underscore (_) character, and words are written in all lower case. It is a commonly used naming convention in computing, for example for variable and subroutine names, and for filenames. One study has found that readers can recognize snake case values more quickly than camel case. However, "subjects were trained mainly in the underscore style", so the possibility of bias cannot be eliminated. A variation is screaming snake case, where words are written in all caps (stylized as SCREAMING_SNAKE_CASE). This convention is used for constants in programming languages like C/C++, Python, Java, PHP, as well as for environment variables.

History The use of underscores as word separators dates back to the late 1960s. It is particularly associated with C, is found in The C Programming Language (1978), and contrasted with pascal case (a type of camel case). However, the convention traditionally had no specific name: the Python programming language style guide refers to it simply as "lower_case_with_underscores". Within Usenet the term snake_case was first seen in the Ruby community in 2004, 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, names for other delimiter-separated naming 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.

Examples The following programming languages use snake case by convention:

ABAP Ada, with initial letters also capitalized C++ Standard Library and Boost for symbols. C++ does not have a widely agreed-upon naming convention for classes and functions by its wider community. C, for some type names in the standard library, and since C11, in some function names. Eiffel, for class and feature names Elixir, for atom, variable, and function names Erlang, for function names GDScript, for variable and function names Java uses SCREAMING_SNAKE_CASE for static final constants and enum values. Kotlin uses SCREAMING_SNAKE_CASE for constants and enum values Magik OCaml, for value, type, and module names Perl, for lexical variables and subroutines Oracle SQL and PL/SQL, for all unquoted identifiers (tables, columns, indexes, constraints, PL/SQL variables, constants, procedures/functions, triggers,...), although not official by Oracle itself, still recommended by the majority of known "influencers" and used throughout the official Oracle documentation All unquoted snake_case identifiers are actually internally represented as SCREAMING_SNAKE_CASE identifiers. Prolog, for both atoms (predicate names, function names, and constants) and variables Python, for variable names, function names, method names, and module or package (i.e. file) names PHP uses SCREAMING_SNAKE_CASE for class constants PL/I R, for variable names, function names, and argument names, especially in the tidyverse style Ruby, for variable and method names Rust, for variable names, function names, method names, module names, and macros Tcl Terraform (software), for resources and variables Zig, for variables

See also Camel case, more common in Java and C# Kebab case, with hyphens instead of underscores, more common in COBOL and LISP Naming convention (programming)

References

External links Snake case converter

Illustrations

Snake case: Piece of code from a module of the Linux kernel, which uses snake case for identifiers
Piece of code from a module of the Linux kernel, which uses snake case for identifiers

Worked examples

Example 1 — a first encounter with Snake case

Start with the simplest possible case. Write down what Snake case claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Snake case before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Snake case ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Snake case

In research
Snake case appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Snake case in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Snake case is common in secondary-school and first-year university syllabi. It links to neighbouring topics Capitalization, Metaphors referring to snakes, Naming conventions, so understanding it makes those chapters shorter.
In everyday life
Look for Snake case outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Snake case” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Snake case in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Snake case means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Snake case out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Snake case in simple terms?

Snake case (sometimes stylized autologically as snake_case) is the naming convention in which each space is replaced with an underscore (_) character, and words are written in all lower case. It is a commonly used naming convention in computing, for example for variable and subroutine names, and fo…

Why does Snake case matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Snake case?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Snake case.

Tags

  • Capitalization
  • Metaphors referring to snakes
  • Naming conventions
  • Source code
  • Typography

Keep exploring