Return to site

Programming cases: camelCase, snake_case, kebab-case, PascalCase, UPPER_CASE_SNAKE_CASE

· coding

When working with computers—specifically while programming—you'll inevitably find yourself naming things (one of the two hard things in computer science).
A major factor of being successful in naming is knowing the type of case you want to use so that you can have a consistent convention per project/workspace.

camelCase

camelCase must (1) start with a lowercase letter and (2) the first letter of every new subsequent word has its first letter capitalized and is compounded with the previous word.
=> camelCaseVar

snake_case

snake_case is as simple as replacing all spaces with a "_" and lowercasing all the words.
=> snake_case_var

kebab-case

kebab-case is as simple as replacing all spaces with a "-" and lowercasing all the words.
=> kebab-case-var

PascalCase

PascalCase has every word starts with an uppercase letter (unlike camelCase in that the first word starts with a lowercase letter).
=> PascalCaseVar

UPPER_CASE_SNAKE_CASE

UPPER_CASE_SNAKE_CASE is replacing all the spaces with a "_" and converting all the letters to capitals.
=> UPPER_CASE_SNAKE_CASE_VAR