There are only two hard things in Computer Science: cache invalidation and naming
things. And part of naming things is deciding HOW to write them. Should it be
userId, user_id, or UserID?
These "casing conventions" aren't just about aesthetics; they are strict standards enforced by
programming languages and communities. Mixing them up (e.g., using snake_case in Java) is a surefire way
to look like a novice. This guide covers every major standard you need to know.
How to Convert Text Case - Simple 3-step workflow
camelCase
Format: First letter lowercase, first letter of subsequent words uppercase. No spaces or
separators.
Highlight the text and use the "Transform to..." command in the Command Palette (Ctrl+Shift+P).
Or better yet, install an extension like "change-case" to bind shortcuts like
Alt+Shift+U for UPPER or Alt+Shift+C for camelCase.
Why does SQL use snake_case?
+
Historical reasons. Older databases were case-insensitive (treating UserTable and
usertable as the same). Underscores provided a reliable way to separate words
without relying on capitalization.
What is Hungarian Notation?
+
An old convention (mostly dead now) where you prefix the variable name with its type. Example:
strName (String Name) or iCount (Integer Count). Modern IDEs show
types on hover, making this redundant and cluttering.
Can I start a variable with a number?
+
No. In almost all programming languages, variable names cannot start with a
digit (e.g., 2user is invalid). They must start with a letter, underscore, or
dollar sign (JS).
What about spaces in filenames?
+
Avoid them like the plague. Spaces cause nightmares in command-line tools
(requiring escaping like file\ name.txt) and URLs (becoming
file%20name.txt). Always use kebab-case (web) or snake_case (data/scripts) for
files.
Is Title Case used in coding?
+
Rarely in code logic, but often in UI strings or comments. Title Case (Capitalizing Every Major
Word) is standard for headlines, buttons ("Sign Up Now"), and menu items.