The Ultimate Guide to Case Conventions in Programming

Julian Rosenblum
2 min readMar 2, 2019

They say there are only two hard things in computer science — cache invalidation and naming things. And how’s an honest coder supposed to name a variable when there are so many conventions to choose from? At long last, I present to you the ultimate guide to case conventions in programming, so that you can stop agonizing about names and go back to doing machine learning on the blockchain or whatever.

You should use camelCase for:

  • Functions
  • Methods
  • Subroutines
  • The occasional wayward proc
  • Even integers
  • Null pointers
  • Pointers to 0x007f8cba
  • Floating points that don’t add up correctly
  • Bits
  • Bytes
  • Booleans
  • Bugs
  • Bezos
  • Friend classes
  • Protected members
  • Private citizens
  • Public displays of affection
  • Strings
  • Epistles
  • Letters to the editor
  • Rants on Hacker News
  • Answers on Jeopardy
  • Snapple facts

You should use snake_case for:

  • Variables
  • Constants
  • Values that better not have changed when you get back damnit
  • Snakes (on plane)
  • Snakes (off plane)
  • Indexes
  • Indices
  • Dictionaries
  • Glossaries
  • Thesauri
  • Object literals
  • Object figuratives
  • Object permanence
  • Objects in mirror
  • Objective-C
  • Objective truth
  • Truthy values
  • Falsy values
  • Values of unreliable veracity
  • Null
  • Nil
  • None
  • undefined
  • Anything that’s == false in JavaScript
  • Anything that compiles into JavaScript
  • Anything that professes to be the current state of the JavaScript ecosystem
  • Incoherent diatribes about LISP
  • People who don’t have strong opinions in the tabs vs. spaces debate
  • Best practices
  • Worst practices
  • Scala

You should use kebab-case for:

  • Positive zero
  • Negative zero
  • Non-trivial zeroes of the Riemann zeta function
  • Strong types
  • Weak types
  • Duck types
  • Rubber ducks
  • Rubber goose
  • Green moose
  • Guava juice
  • Functional practices in imperative languages
  • Imperative practices in functional languages
  • Whatever the hell prolog is
  • Type coercions
  • Syntax errors
  • Segfaults
  • HTML attributes
  • Inline styles
  • That interview question where you have to invert a binary tree
  • Semaphores
  • Deadlocks
  • Birkenstocks
  • Bootstraps
  • Bootloaders
  • Reboots
  • Spinoffs
  • The Seinfeld reunion that will never happen
  • Linked lists
  • Absurdist lists
  • Esoteric debates
  • Jeff Dean facts
  • 10x developers
  • 24 karat magic
  • Someone somewhere out there who thinks we should have a 9-bit word size
  • The 2038 problem
  • Unsigned long longs
  • Stack overflows
  • Piping into /dev/null
  • Void stars
  • The Void
  • Misery
  • Woe
  • A purposeless existence
  • Using a hundred-thousand-dollar GPU to figure out if a picture has a cat in it
  • chmod
  • fsck
  • Ctrl-C
  • Ctrl-D
  • However the hell you get out of vim
  • Hello world
  • Hello
  • Seriously
  • Is there anybody out there
  • I can’t do this anymore
  • Make it stop
  • 400 Bad Request
  • 500 Internal Server Error
  • Goto Considered Harmful
  • Python 3

--

--