clean-codejs-naming
Installation
SKILL.md
Clean Code JavaScript – Naming Patterns
Table of Contents
- Principles
- Variables
- Functions
- Booleans
- Bad vs Good Examples
Principles
- Names should reveal intent
- Avoid abbreviations and mental mapping
- Use domain language consistently
Variables
// ❌ Bad
const d = 86400000;
// ✅ Good
const MILLISECONDS_PER_DAY = 86400000;
Functions
// ❌ Bad
function getUser(u) {}
// ✅ Good
function fetchUserById(userId) {}
Booleans
// ❌ Bad
if (!user.isNotActive) {}
// ✅ Good
if (user.isActive) {}
Bad vs Good Examples
// ❌ Bad
const data = getData();
// ✅ Good
const usersResponse = fetchUsers();
Related skills
More from damianwrooby/javascript-clean-code-skills
clean-codejs-functions
Function design patterns emphasizing single responsibility and clarity.
97clean-codejs-modules
Module and file-structure patterns for clean JavaScript architecture.
82clean-codejs-objects
Object and class design patterns following Clean Code JavaScript.
72clean-codejs-comments
Commenting patterns that improve readability and maintainability.
6