Search code examples
naming-conventionspascalnaming

Where does the word "Pascal Case" come from?


In general, there are four common case styles.

  1. camelCase

  2. PascalCase

  3. snake_case

  4. kebab-case

Etymology of first, third and fourth styles are trivial. But what about second one (i.e. PascalCase)?


According to wikitionary,

Etymology

Referring to the Pascal programming language.

and the link only says

Letter case is ignored in Pascal source.


According to Free Pascal wiki,

Rules for identifiers:

  • Must begin with a letter from the English alphabet or an underscore (_).
  • Can be followed by alphanumeric characters (alphabetic characters and numerals), or the underscore (_).
  • May not contain special characters, such as: ~ ! @ # ...

(snip)

Pascal is not case sensitive! MyProgram, MYPROGRAM, and mYpRoGrAm are equivalent. But for readability purposes, it is a good idea to use meaningful capitalization!

There are two possible methods you could choose to apply to your identifiers: CamelCase and underscore as space. CamelCase, as it appears, means that separate words in an identifier are capitalized, so that you have newPerson or NewPerson instead of newperson. Using underscore as space means you separate words in an identifier with underscores, so that you have new_person instead of newperson. Or you could combine the two, so that you have new_Person or New_Person instead of newperson.

, which implies it is not required to use a camel-case identifier such as StackOverflow or RedHatLinux.


Then, where does the word "camel case" come from? Did pascal programmers first started using PascalCase style?


Solution

  • The history about putting words together using casing goes back a long time.

    From Capitalize My Title:

    CamelCase was primarily used in chemistry as a way to notate chemical compounds and formulas. In 1813, Berzelius, a Swedish chemist, suggested that the chemical elements should be represented consisting of one or two letters with the first one capitalized. The term used for this convention was medical capitals.

    A step into the twentieth century:

    In the early twentieth century, medical capitals used in Chemistry has been adopted in product trademarks and corporate names. However, the use is not yet prevalent. Some examples of these products include DryIce Corporation, CinemaScope, a widescreen movie format, MisterRogers, and VistaVision, among others.

    And in programming language:

    Around the 1970s and 1980s, the use of medical capitals was also adopted as an alternative naming convention for identifiers in various programming languages. For instance, on the General Purpose Macro Processor (GPM) by Christopher Strachey, a program includes identifiers using medical capitals. These include “WriteSymbol,” and “NextCh.”

    Late 1990s:

    By the late 1990s, the lower camel case became a popular trend in many brands. The lowercase for “i” which may stand for internet, information, or intelligent, and “e” which stands for electronic, became prefixes to various words. Examples of these words include eBay, iMac, eBox, and iPod.

    The name CamelCase:

    The term CamelCase only came into existence in the 1990s. Before that, the term medical capitals was commonly used. In April 1990, the term “InterCaps” was used by Avi Rappoport to describe the manner of capitalization. In 1991, Eric S. Raymond made mention of BiCapitalization to identify it.

    It was not until 1995, however, that its current name was used. In a post by Newton Love, he mentioned that the humpiness of the style made him call it HumpyCase at first, before settling with CamelCase.

    The origin of the name PascalCasing (from History around Pascal Casing and Camel Casing):

    In the initial design of the Framework we had hundreds of hours of debate about naming style. To facilitate these debates we coined a number of terms. With Anders Heilsberg (the original designer of Turbo Pascal) a key member of the design team, it is no wonder that we chose the term Pascal Casing for the casing style popularized by the Pascal programming language.

    We were somewhat cute in using the term camelCasing for the casing style that looks something like the humps on a camel. We used the term SCREAMING CAPS to indicate an all upper case style. Luckily this style (and name) did not survive in the final guideline.


    >Did pascal programmers first started using PascalCase style?
    

    No, it was a common convention at that time when programming languages was evolved.


    More references about Camel Case