# Clean Code Principles Confidence: high Last verified: 2026-05-22 Generation: human_only ## TL;DR Clean Code principles (Robert C. Martin) guide writing readable, maintainable code. Key rules: meaningful names (reveal intent), small functions (do one thing), minimal arguments (0-2 ideal), no side effects, DRY (Don't Repeat Yourself), comments explain WHY not WHAT. Code is read 10x more than written. ## Core Explanation Meaningful names: `customerList` not `cl`, `calculateTotalPrice` not `calc`. Functions: should be small (20 lines max), do one thing at one level of abstraction. Comments: explain intent, warn of consequences, TODO notes. Don't comment bad code — rewrite it. Error handling: use exceptions over return codes, provide context. Boy Scout Rule: leave the code cleaner than you found it. ## Further Reading - [Clean Code (Robert C. Martin)](undefined)