Skip to content

Naming cheatsheet

A guide of naming rules for variables and functions, written in plain examples, language-agnostic.

Stars
14.2k
Forks
946
Licence
MIT
Language
—
Last update
2.7 years ago
Type
Learning resource

No commits in over a year — check for forks or alternatives before adopting.

What it is

This is a written style guide for choosing names for variables and functions in code. It explains principles such as using English, picking one naming convention, avoiding contractions, and using a verb-plus-context pattern (A/HC/LC) for function names. The examples are in JavaScript, but the author states the ideas apply to any language.

  • Reviewing function names in a pull request against the action and context pattern
  • Adopting a single naming convention such as camelCase for a project
  • Using the prefix guidance (is, has, should) for boolean variables
  • Choosing between remove and delete for function names using the author's examples

Great for

  • Developers who want more consistent, readable names in their code
  • Teams writing a shared naming guideline
  • Students learning how to name variables and functions
  • Code reviewers who need a reference to point to in discussions

Not ideal for

  • People looking for a tool or program to install, since this is a reference document with no install step
  • Readers who need rules specific to one language's official conventions, since the README defers to each language's own documentation
Step-by-step guide: how to use Naming cheatsheetInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Read it online

    Clone the repository

    git clone https://github.com/kettanaito/naming-cheatsheet
  2. 2

    Run it

    • Open the repository page on GitHub and read the README from top to bottom
    • Start with the English language and naming convention sections
    • Read the S-I-D and avoid contractions sections for the basic rules
    • Use the A/HC/LC pattern section when naming functions
  3. 3

    Get the most out of it

    • Read the A/HC/LC table and the note on context order to understand how word order changes meaning
    • Pair the remove versus delete section with its add and create explanation
    • Follow the linked issue for a deeper explanation of the remove and delete distinction
    • Adopt one convention for your team and write it down, as the README recommends

Downloads

Strengths

  • Short, concrete good-versus-bad examples for each rule
  • Language-agnostic principles with a clear, consistent structure
  • Widely starred and MIT licensed, so it can be copied into team docs

Trade-offs

  • The README shown is truncated, so some sections may be missing from this summary
  • Examples focus on JavaScript, so readers in other languages must translate the ideas themselves
  • Some guidance is opinion-based and the README itself frames it as suggestions

How it compares

ProjectStarsTypeLevelUpdatedBest for
naming-cheatsheet (this)14.2kLearning resourcebeginner2.7 years agoDevelopers who want more consistent, readable names in their code
awesome-cheatsheets46.6kLearning resourcebeginner20 days agoDevelopers brushing up on a language or tool they use only occasionally
project-guidelines29.4kLearning resourcebeginner1.9 years agoTeams that want a shared written standard for Git branching and pull requests
algorithm-pattern15.5kLearning resourcebeginner5 months agoPeople preparing for coding interviews who want to study by topic
reference15.2kLearning resourcebeginner6 days agoDevelopers who want a quick lookup for syntax or commands they use occasionally
the-book-of-secret-knowledge255kCurated listbeginner2.0 years agoSystem and network administrators looking for a reference of tools and howtos

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.