What problem does it solve?
Write readable, maintainable code through disciplined naming, small functions, and clean error handling. Use when the user mentions "code review", "naming conventions", "function too long", "code smells", or "readable code". Covers SRP, comment discipline, formatting, and unit testing. For refactoring techniques, see refactoring-patterns. For architecture, see clean-architecture.
Core Features & Use Cases
- Meaningful Names: Names reveal intent and reduce confusion across the codebase.
- Small Functions: Prefer 4-6 lines, zero to two arguments, no side effects, single abstraction level.
- Error Handling & Testing: Separate concerns; use exceptions; promote robust unit tests.
- Refactoring Guide: Use the Boy Scout Rule and Extract Till You Drop to incrementally improve code quality.
- Code Smells Awareness: Detect and address duplication, misabstraction, and unsafe patterns using the included references.
Quick Start
Apply the clean-code principles in your next code change to improve readability and maintainability.