Camel case facts for kids
Camel case (sometimes written as camelCase or CamelCase) is a way of writing phrases without spaces or punctuation. Instead, you capitalize the first letter of each word. Think of famous examples like "YouTube", "iPhone", and "eBay". It's often used in computer programming to name things. You might also see it in online usernames, like "JohnSmith", or to make website names easier to read, such as "EasyWidgetCompany.com".
There are two main types of camel case. Pascal case (or upper camel case) means every word starts with a capital letter, even the very first word. For example, "PascalCase". Lower camel case (also called dromedary case) means the first word starts with a lowercase letter, but all following words start with a capital. For example, "lowerCamelCase". Some people use "camel case" only for the lower version, but in this article, we'll use it for both unless we say otherwise.
Camel case is different from title case, where all words are capitalized but still have spaces between them (like "This Is Title Case"). It's also not like snake case, which uses underscores between words, like "snake_case".
Contents
What is Camel Case?
Camel case is a style of writing where you join words together without spaces. You make the first letter of each new word a capital letter. This makes it easier to read words that are stuck together.
Why is it called Camel Case?
It's called camel case because the capital letters in the middle of a word look like the humps on a camel's back. The up-and-down pattern of capital and lowercase letters creates a "humpy" shape.
Different Names for Camel Case
People have many names for this writing style, including:
- CamelBack or CamelCaps
- CapitalizedWords or CapWords (especially in Python)
- Embedded caps
- HumpBack notation
- InterCaps (short for Internal Capitalization)
- Medial capitals (a more formal name)
- MixedCase (for lower camel case in Python)
- PascalCase (named after the Pascal programming language)
- Smalltalk case
- WikiWord or WikiCase (used in older wikis)
The name "Camel Case" was first used in 1995 by a person named Newton Love. He said he used to call it "HumpyCase" because of how it looked.
Camel Case in Everyday Language
While not super common, camel case sometimes appears in regular language, especially when combining words or names.
Combining Words
- In German, you might see StudentInnen to mean both male and female students. However, this isn't standard German spelling.
- In Irish, it's used when a prefix is added to a proper noun. For example, i nGaillimh means "in Galway".
- In Dutch, when the letters ij are capitalized, both I and J become capital, like in IJsland ("Iceland").
- In Chinese pinyin, camel case can make place names clearer. For example, Beijing can be written as BeiJing, showing it has two parts.
- In English, you often see it in Scottish or Irish names like MacDonald or FitzGerald.
In Abbreviations
Camel case is often used in abbreviations where the original words would be capitalized. For example, PhD or BSc. A more recent example is NaNoWriMo, which stands for National Novel Writing Month. In German, many laws are abbreviated this way, like StGB for Strafgesetzbuch (Criminal Code).
History of Camel Case in Technology
Chemical Formulas
One of the first times camel case was used in a systematic way for technical stuff was in 1813. A Swedish chemist named Jacob Berzelius invented a way to write chemical formulas. He used one or two letters for each chemical element, with the first letter capitalized. This allowed him to write formulas like "NaCl" (table salt) without spaces, and everyone could still understand them. This system is still used today!
Early Brand Names
Since the early 1900s, companies have sometimes used camel case for their names and products. Some examples you might know include:
- DryIce (1925)
- CinemaScope (1953)
- AstroTurf (1967)
- Mister Rogers' Neighborhood (1968)
- MasterCard (1979)
- SportsCenter (1979)
Computer Programming
In the 1970s and 1980s, camel case became popular for naming things in computer programs. Most programming languages don't allow spaces in names. So, instead of writing `end of file`, which would confuse the computer, programmers needed a way to make `endoffile` easier to read.
Some older languages used hyphens, like `END-OF-FILE`. But other languages, especially those used for math, used hyphens for subtraction. So, they needed another way. When the ASCII character set became common in the late 1960s, it brought lowercase letters and the underscore character (`_`). Some languages, like C, started using underscores: `end_of_file`. But others preferred camel case, like `endOfFile`.
One story says that camel case became popular at Xerox PARC around 1978. Their computers didn't have an underscore key, and spaces or hyphens weren't allowed in names. So, camel case was the best way to make names readable. Languages like Smalltalk and Modula also started using it, helping it spread.
Computer Companies and Products
Camel case became a trend for computer companies and their products starting in the late 1970s. This trend continues today!
- (1977) CompuServe
- (1978) WordStar
- (1979) VisiCalc
- (1982) WordPerfect
- (1984) LaserJet
- (1987) PowerPoint
- (1990) WorldWideWeb (the first web browser)
Spreading Everywhere
By the 1990s, as personal computers became common, camel case started appearing in many other areas too.
- (1985) EastEnders (a TV show)
- (1990) HarperCollins (a book publisher)
- (1998) PricewaterhouseCoopers (a business company)
During the "dot-com bubble" of the late 1990s, you saw many names starting with "e" (for "electronic") or "i" (for "Internet" or "information"). Think of Apple's iMac!
Camel case is also used for short names of neighborhoods, like SoHo (South of Houston Street) in New York City.
Camel Case in Today's Computing
Programming and Coding
Many programming languages and software projects recommend using camel case for naming things. For example, languages like Java and Microsoft's .NET often use it. Programmers often follow specific rules about whether to use upper or lower camel case for different types of names (like variables, functions, or types).
Wiki Links
Some wiki markup languages use camel case to automatically create links to other pages. This was used in the very first wiki software, WikiWikiWeb. While Wikipedia used to do this, it now uses square brackets for links, like `this page`.
Other Uses
- File Names: When you save files on a computer, especially if you use a command-line interface, it's easier to use camel case for names with multiple words, like `MyJobResume.pdf`. This avoids problems with spaces.
- Hashtags: On social media, long hashtags often use camel case to make them easier to read (e.g., #CollegeStudentProblems). This also helps screen readers for people with visual impairments.
- Website URLs: In website addresses, spaces are replaced by `%20`, which makes the address longer and harder to read. Using camel case avoids this problem.
Is Camel Case Easy to Read?
Some studies have looked into whether camel case is easy to read.
- A 2009 study found that people recognized camel case names more accurately than snake case names (with underscores). However, they recognized snake case names faster.
- A 2010 study with expert programmers found that snake case was still read faster. This was because people spent more time looking at camel case words.
So, while some people prefer one style over the other, both are widely used and understood in the world of computers!
See also
- All caps
- Alternating caps
- Capitalization
- Caps lock
- Kebab case
- Naming convention (programming)
- Shift key
- Small caps
- Snake case
- Unicase
In Spanish: Camel case para niños