| name | self-documenting-code-checklists |
| description | Use this skill when writing, reviewing, or refactoring code to ensure it is self-documenting. Apply these checklists to routines, data naming, data organization, and overall code layout to improve code clarity and maintainability without relying on comments. |
Self-Documenting Code Checklists
Self-documenting code communicates its purpose through clear naming, structure, and organization rather than through comments. Use these checklists to evaluate and improve code clarity.
When to Use
- Writing new routines, functions, or methods
- Conducting code reviews
- Refactoring existing code for maintainability
- Evaluating code quality and readability
Routine Design Checklist
Apply this checklist when designing or reviewing functions, methods, and subroutines:
Action: If any item is "no," refactor the routine.
Data Naming Checklist
Apply this checklist when declaring or naming variables, constants, and types:
Action: Rename variables or introduce constants if magic numbers or ambiguous names are found.
Data Organization Checklist
Apply this checklist when organizing data access and structures:
Action: Refactor data structures or introduce intermediate variables to simplify logic.
Layout and Design Checklist
Apply this checklist when reviewing code layout or high-level design:
Action: Format and simplify code if it is too "clever" or the layout is confusing.