Better Programming

Advice for programmers.

Follow publication

Member-only story

Case Styles: Camel, Pascal, Snake, and Kebab Case

Patrick Divine
Better Programming
Published in
3 min readNov 3, 2018
Photo by Oskar Yildiz on Unsplash

TLDR;

  • camelCase
  • PascalCase
  • snake_case
  • kebab-case

Removing spaces between words

In programming, we often remove the spaces between words because programs of different sorts reserve the space (‘ ’) character for special purposes. Because the space character is reserved, we cannot use it to represent a concept that we express in our human language with multiple words.

As an example, the concept of user login count is not referenced in our code as user login count often. We do not do the following:

user login count = 5

A typical language parse would treat each word as a separate concept. User, login, and count would each be treated as separate things. So, we do something like the following:

userLoginCount = 5

Now, the parser will see one concept, userLoginCount, and us programmers can easily see the representation.

The best way to combine words

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Write a response