🧩Naming Convention
Also known as Naming Conventions, camelCase, snake_case, PascalCase, kebab-case
A team rule for how to write names in code, like camelCase.
Think of it like
Think of it like a school rule for name tags. Every tag puts the first name first.
Example
Lucy's team writes variables as userName and classes as UserProfile. A new hire reads the code. At a glance, they can tell a class from a variable.
Why it matters
Code is read far more often than it is written. Names that follow one rule are faster to read and harder to mix up.
Definition
Example code
javascript
const userName = 'Lucy'; // camelCase
class UserProfile {} // PascalCase
const MAX_RETRIES = 3; // UPPER_SNAKE_CASECommon mistake
Key takeaways
- 1One shape. camelCase, snake_case, PascalCase.
- 2Names carry meaning. Like isReady or hasItems.
- 3Follow the language. Each has its habits.