refactor
Improve code structure while preserving behavior.
Patterns
- Extract function/method
- Rename for clarity
- Replace conditionals with polymorphism
- Introduce parameter object
- Decompose conditional
- Replace temp with query
- Encapsulate field
Process
- Ensure tests exist or write them first
- Small, incremental changes
- Run tests after each change
- Commit frequently
- Never refactor and add features together