What is camel case? And what other kinds of cases are there such as PascalCase, snake_case etc

October 26, 2018

Camel case is where you write words/phrases so that each word begins with a capital letter (but lower case for the rest of the word), and there is no space (or other punctuation) between words. It is often used for function/method names, or variables. For example showBlogPosts().

(Note: often the first character will be lower case for things like method names and parameters. The first character will often be upper case for class names (e.g. class BlogController {...} - this is known as PascalCase.

Other alternatives include kebab-case (all lowercase, separated by a hyphen -). Also known as lisp-case or spinal-case.

snake_case is lowercase with words separated by an underscore (more details about snake case here)

There is also Train-Case (lowercase, but first letter uppercase, separated by hyphens).