Skip to main content

Case Styles

Case Styles

Reading through Google news, I came across a term I never heard before that really stuck with me. "kebab-case". This is often what I use when naming files that are composed up multiple words. Others were suggesting that this is the best convention for git branch names as well. To recap, here is a list of the different case types:

  • camelCase - Commonly used as Instance names in OO languages.
  • PascalCase - Commonly used as Class names in OO languages.
  • snake_case - Common convention for K&R C.
  • kebab-case - Good for filenames, git branches
  • StUDlyCAps - Good for trolling and texting while driving.

Of course there is a Wikipedia article on the subject: Naming Convention (Programming)

There is also a more general linguistic article on Letter Case. In this article they include things such as:

  • Sentence case - "The quick brown fox jumps over the lazy dog"
  • Title case - "The Quick Brown Fox Jumps over the Lazy Dog"
  • Start case - "The Quick Brown Fox Jumps Over The Lazy Dog"
  • All caps - "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  • Small caps - All caps with a font face size smaller than the normal font face size.
  • Lower case - "the quick brown fox jumps over the lazy dog"

There are more and each with their subtle differences and rules.

Comments