If you were to open a modern dictionary and look for the word “iPhone”, you would find it immediately recognizable. But strictly speaking, capitalized grammar rules from a century ago would label it an aberration: a capital letter following a lowercase letter within a single word is a linguistic anomaly. Yet, in the digital age, this style is ubiquitous.
Welcome to the world of programmer orthography. While most people view computer code as a series of mathematical instructions, linguists view it as a constructed language (conlang) with rigid syntax but fluid morphology. One of the most fascinating aspects of this “dialect” is how it handles the concept of the compound word. In natural languages like English, we use spaces to separate distinct concepts. In the grammar of code, however, the specific use of the Space Bar is often strictly reserved as a delimiter—a border guard separating commands.
So, how does a programmer express the complex idea of “the number of users currently active” without spaces? They turn to orthographic conventions that act as grammatical glue: CamelCase, snake_case, and kebab-case. These are not merely aesthetic choices; they are the dialect markings of distinct programming communities.
The Orthography of Necessity
To understand why these cases exist, we must look at the rules of the coding environment. In almost every programming language, a space signifies a break. If you type user name in a script, the computer reads it as two separate entities: user (perhaps a command) and name (incorrect syntax). The machine creates a parsing error.
Linguistically, programmers fix this by creating compound lexemes. Just as German combines Schaden (damage) and Freude (joy) to create Schadenfreude, coders must fuse words. The method of fusion they choose depends entirely on the dialect (programming language) they are speaking.
CamelCase: The Germanic Agglutination
CamelCase describes the practice of joining words together without spaces, capitalizing the first letter of each constituent part inside the compound. The visual result resembles the humps of a camel. There are two “genders” of this case:
- UpperCamelCase (PascalCase): The first letter is capitalized (e.g.,
PageCount). - lowerCamelCase: The first letter is lowercase, while subsequent words are capitalized (e.g.,
iPhone,ebay, ortotalAmountPaid).
From a linguistic perspective, CamelCase is highly agglutinative. It smooshes morphemes together to create a single, unified visual unit. It is the dominant dialect of the Java and JavaScript communities. In these languages, CamelCase usually indicates a specific hierarchy. For example, in Java, classes (the blueprints of objects) usually use PascalCase (CustomerAccount), while specific instances use lowerCamelCase (newCustomer).
This mimics the capitalization of Proper Nouns versus common nouns in English. By using CamelCase, the programmer is signaling to the reader: “This is a singular, specific conceptual unit.”
snake_case: The Visual Rhythm of Antiquity
If CamelCase is the “German” of coding orthography, snake_case is its more spaced-out cousin. Snake_case separates words with an underscore (_), resulting in total_amount_paid or current_user_id.
Linguistically, the underscore functions as a silent connector—a phantom space. It preserves the rhythm of natural reading more effectively than CamelCase because it physically separates the phonemes. Studies on programmer cognition have occasionally suggested that snake_case is faster to read for unparalleled eyes because it mimics the natural spacing we are accustomed to in prose.
This style is the prestige dialect of the Python programming language. Python places a high premium on readability and “clean” aesthetics. The Python style guide (PEP 8), which acts as the prescriptive grammar handbook for the language, strictly enforces snake_case for functions and variables. Using CamelCase in Python is akin to speaking with a heavy foreign accent; the code runs, but it feels “grammatically” incorrect to the native community.
kebab-case: The Lisp of the Web
The third major player is kebab-case (also known as spinal-case or Lisp-case). Here, words are separated by hyphens: background-color or my-cool-project. It looks like a skewer running through the words.
In the linguistics of code, kebab-case faces a unique semantic hurdle. In most programming languages, the hyphen (-) is mathematically reserved as the subtraction symbol. If a computer sees user-id, it usually tries to calculate “user minus id.”
Therefore, kebab-case is practically extinct in mathematical scripting languages like Python or C++, but it thrives in markup languages and style sheets like HTML and CSS. When you browse a website, the visual layout is defined by Lisp-based grammatical structures that rely heavily on the hyphen. It is a distinct orthography for a distinct domain.
Code Prescriptivism and “Accents”
In natural language linguistics, we often battle between descriptivism (analyzing how language is actually used) and prescriptivism (enforcing how language *should* be used). The world of coding is aggressively prescriptivist.
Programming communities maintain “Style Guides” or “Linters”—programs that automatically scan code and flag orthographic errors. If a team decides that their dialect uses snake_case, and you submit code in CamelCase, the linter will reject it. It is as if Microsoft Word refused to let you save a document because you used British spelling instead of American.
These conventions serve a vital communicative function: Cognitive Ease. Programming is mentally taxing. By enforcing a strict orthographical grammar, developers reduce the cognitive load required to read code. When a JavaScript developer sees a capitalized word (User), they instantly know it is a Class constructor. When they see a lowercase word (user), they know it is a variable. The orthography conveys meta-information about the word’s grammatical function within the code.
Semantic Naming: The Verb-Noun Agreement
Beyond the casing (orthography), there is the matter of semantics (meaning). The grammar of code naming conventions acts very much like the grammar of sentence structure.
- Boolean Variables (True/False): These are usually phrased as questions.
is_active,has_cracked_screen, orcanWrite. The linguistic prefix “is” or “has” marks the variable as a binary state. - Functions (Actions): These are almost always imperative verb phrases.
calculateTotal(),fetch_data(), orprint_name(). A noun-only function name likedata()is considered “ungrammatical” because it doesn’t describe the action being performed.
Conclusion: Code as Literature
We often make the mistake of thinking that code is written for computers. In reality, source code is written for human beings; the computer only cares about the zeros and ones compiled at the end of the process. The choice between CamelCase, snake_case, and kebab-case is a choice of dialect, culture, and readability.
Just as a linguist might analyze the evolution of the compounding of English words, we can analyze the orthographic evolution of programming. Whether we are smoothing our words together like camel humps or linking them with underscored tendons, we are engaging in the very human act of creating structure out of chaos—one variable name at a time.