Naming conventions do not affect whether code runs β they determine whether code is maintainable by the next developer who reads it, including your future self.
JavaScript and TypeScript
Variables and functions: camelCase. Classes and interfaces: PascalCase. Constants: SCREAMING_SNAKE_CASE. Private members: underscore prefix. React components: PascalCase. Custom hooks: use prefix camelCase.
Python
Variables and functions: snake_case. Classes: PascalCase. Constants: UPPER_SNAKE_CASE. Private: single underscore. Module names: short lowercase.
CSS and HTML
Classes: kebab-case. Custom properties: --kebab-case. IDs: kebab-case. BEM: Block__Element--Modifier.
SQL
Tables: plural snake_case. Columns: snake_case. Primary keys: id or table_id. Foreign keys: referenced_table_id. Indexes: idx_table_column.
Convert any text between naming conventions instantly with the Text Case Converter β paste plain English and convert to camelCase, snake_case, PascalCase, or kebab-case.
Naming Conventions Across All Major Languages
Naming conventions encode semantic information that helps developers read unfamiliar code faster. JavaScript uses camelCase for variables and functions, PascalCase for classes, and SCREAMING_SNAKE_CASE for constants. Python uses snake_case for everything except classes (PascalCase) and constants (UPPER_SNAKE_CASE). CSS uses kebab-case for class names and custom properties. SQL uses snake_case for tables and columns. These conventions are not arbitrary β they evolved from community experience about what makes code most readable.
The most impactful naming convention principle is the single responsibility rule: a variable's name should completely describe what it contains without needing a comment. A variable named d needs a comment. A variable named daysSinceLastLogin is self-documenting. The extra characters in the longer name are an investment that pays back every time the code is read. Teams that adopt descriptive naming conventions report significantly fewer questions about variable purposes in code reviews.
Convert variable names between any naming convention with the Text Case Converter.
Naming Conventions Across Languages
Python enforces snake_case for variables and functions, PascalCase for classes, and UPPER_SNAKE_CASE for constants via PEP 8. JavaScript uses camelCase for variables and functions, PascalCase for classes, and SCREAMING_SNAKE_CASE for constants. Go uses MixedCaps where the capitalisation determines export visibility β uppercase identifiers are exported from a package, lowercase are unexported. Rust uses snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants.
SQL uses snake_case universally for table and column names, with plural table names (users, orders) and descriptive column names (first_name, created_at, is_active). CSS uses kebab-case for class names and custom properties. Shell scripts use UPPER_SNAKE_CASE for environment variables. These conventions encode ecosystem identity β seeing getUserById immediately identifies JavaScript or TypeScript; seeing get_user_by_id identifies Python or Ruby.
Boolean Naming Patterns
Boolean variables and functions have a universal naming convention that transcends language: use a prefix that makes the true/false meaning obvious. Standard prefixes: is_ (is_active, is_published, is_verified), has_ (has_permission, has_errors, has_children), should_ (should_redirect, should_cache), can_ (can_edit, can_delete), will_ (will_expire), and past tense verbs (expired, deleted, verified). A variable named status is ambiguous β it could be a string, an enum, or a boolean. A variable named is_active is unambiguously boolean.
Negated booleans β naming a variable after a negative condition β cause readability problems. is_not_active forces double negation in conditions: if (!is_not_active) reads poorly. Always name booleans after the positive condition and negate in code: is_active = true means active; if (!is_active) means inactive. This pattern also avoids the confusing double negation when the variable is set to false.
File and Module Naming
File naming conventions determine import path readability and project structure clarity. React components use PascalCase matching the component name: UserProfile.tsx exports a UserProfile component. Utility files use camelCase or kebab-case: dateUtils.ts or date-utils.ts. Test files mirror the source file with a .test or .spec suffix: UserProfile.test.tsx. Python modules use snake_case: user_profile.py. The one-file-one-export pattern, where each file exports exactly one primary thing named after the file, makes imports predictable and searchable.
Convert between any naming convention with the Text Case Converter. camelCase, snake_case, PascalCase, kebab-case β instant conversion.