What is camelCase, snake_case, PascalCase & kebab-case?

What is camelCase, snake_case, PascalCase & kebab-case?

By Qisti

These are naming styles used to make names easier to read, more consistent, and better organized when working with code, files, and databases.


🐫 camelCase

Example: userName, totalAmount, isLoggedIn
Style: Starts with a lowercase letter; each new word begins with a capital letter.

Commonly used for:

  • Variable names
  • Function names
  • Form field identifiers

🐍 snake_case

Example: user_name, total_amount, is_logged_in
Style: All lowercase, words are separated by underscores.

Commonly used for:

  • Database field names
  • File names
  • Configuration keys

PascalCase

Example: UserName, TotalAmount, IsLoggedIn
Style: Every word starts with a capital letter, including the first.

Commonly used for:

  • Object or data structure names
  • Component or class names

🥙 kebab-case

Example: user-name, total-amount
Style: All lowercase, words separated by hyphens (dashes).

Commonly used for:

  • URLs (e.g., /user-profile)
  • File or folder names
  • Web component names
  • Form field identifiers

✅ Why They Matter

  • Consistency — Reduces confusion and human error.
  • Scalability — Keeps structure clean in big projects.
  • Teamwork — Ensures everyone follows the same naming patterns.