• camelCase
  • PascalCase
  • snake_case
  • kebab-case
Photo by Oskar Yildiz on Unsplash

Camel

Photo by waad salman3 on Unsplash

Camel case combines words by capitalizing all words following the first word and removing the space, as follows:

Raw:

user login count

Camel Case: 

userLoginCount

Snake

Photo by David Clode on Unsplash

Raw:

user login count

Snake Case:

user_login_count

Snake Case (All Caps): 

USER_LOGIN_COUNT

Pascal Case (PascalCase)

Pascal case combines words by capitalizing all words (even the first word) and removing the space, as follows:

Raw:

user login count

Pascal Case:

UserLoginCount

This is also a very popular way to combine words to form a single concept. It is often used as a convention in declaring classes in many languages.

Kebab Case (kebab-case)

Photo by Michaela Baum on Unsplash

Kebab case combines words by replacing each space with a dash (-), as follows:

Raw:

user login count

Kebab Case:

user-login-count

This style is often used in URLs. For example, http://www.blog.com/cool-article-1. It is a nice, clean, human-readable way to combine the words.

Which is best?

There is no best method of combining words. The main thing is to be consistent with the convention used, and, if you’re in a team, to come to an agreement on the convention together.

Source: https://betterprogramming.pub/string-case-styles-camel-pascal-snake-and-kebab-case-981407998841