The Cusp of Helix

Intact Case [Details]

Camel Case 

As you know, camel case is one of the most famous naming convention. For expressing by joining compound words to variable name in programming language, to capitalize first letter of each word without first word.

camel + casecamelCase
get + raw + keysgetRawKeys

It is self-evident that first word is recognized easily, and first word does not need to capitalize. However there is other kind of camel case with expressing to capitalize first word. In general, It is given one of various names according to the notations, as follows.

An Initial Letter of First WordGeneral Name
lower casecamel case
upper casestudly caps

Camel case is used in such as Java and C#. There is custom in Java, camel case and studly caps are used to distinguish class name and method name.

method namecamel case
class namestudly caps

External Links

Underscore Notation

Underscore notation is another method to join compound words as famous as camel case. It is called usually "snake case". In snake case, convert all words to lower case and Concatenate all words with underscore.

snake + casesnake_case
get + raw + keysget_raw_keys

In underscore notation, all words are written in lower case. Another notation that all words are written in upper case is called "screaming snake case". It is used to name constants in many programming languages.

snake + caseSNAKE_CASE
get + raw + keysGET_RAW_KEYS

Underscore notation, which was changing the delimiter to hyphen, is referred to as "chain case". In addition, as "train case" and as "kebab case".

Within this article, it is collectively referred such underscore and hyphen as "delimiter".

The Purpose

The purpose of camel case and underscore notation are summarized as follows.

When expressing variable name and method name by joining compound words, to improve the readability of words.

When the method to get the current time is named by compound words such as "get current time", if to concatenate simply, it will be seen that the readability is very lower.

getcurrenttime

In camel case or underscore notation, it can recognize easily the words separated.

original wordsget + current + time
camel casegetCurrentTime
underscore notationget_current_time

About Notation

In this article, it is referred to each notation as follows.

NotationExpression
camel caselower casecamelCase
upper caseStudlyCaps
underscore notationsnake_case
hyphen delimiter notationtrain-case