camelCase

camelCase

Camel case is the camel pattern with empty string delimiter.

Camel case is also known as mixed case or lower camel case (to distinguish it from pascal case).

History

Google’s C++ style guide refers to camel case as mixed case, and further describes how you would define the words that compose an identifier, and then even mentions abbreviations. 1

For the purposes of the naming rules below, a “word” is anything that you would write in English without internal spaces. This includes abbreviations, such as acronyms and initialisms. For names written in mixed case (also sometimes referred to as “camel case” or “Pascal case”), in which the first letter of each word is capitalized, prefer to capitalize abbreviations as single words, e.g., StartRpc() rather than StartRPC().

They also use mixed case to refer to both camel case and pascal case. Google further uses mixed caps to describe this case in its Go style guide. 2

Go source code uses MixedCaps or mixedCaps (camel case) rather than underscores (snake case) when writing multi-word names.

Interestingly, Go uses pascal case and camel case to not only distinguish between exported and unexported identifiers, but also permit variables to be exported by enforcing pascal case. This clear distinction of intent between the two is fascinating, given that the guide exclusively uses the name mixed caps to refer to both.

Examples

Variables and functions in Java are written in camel case.

Java
public int addTwo(int a) {
    int numberPlusTwo = a + 2;
    return numberPlusTwo;
}

In Go, unexported identifiers like local and private variables and functions are written in camel case.

Go
package main

import "fmt"

type person struct {
    name string
    age  int
}

func newPerson(name string) *person {
    p := person{name: name}
    p.age = 24
    return &p
}

func main() {
    fmt.Println(person{"Alice", 20})
}