More in this categoryCoding Prompts
10 / 12
Coding prompt
Refactor Legacy Function
Clean up legacy code without breaking behavior.
Published · Updated

Refactor prompt
Refactor this legacy function for readability and performance WITHOUT changing its behavior. Apply: meaningful variable names, extract helper functions, remove duplication, and modern [LANGUAGE] idioms. Show a before/after diff summary of what changed and why. Code: [PASTE CODE]
Related prompts
Coding Prompts2 phasesLegacy Code Modernization
Analyze legacy risks, then modernize safely.
- Amazon Q Developer
By Rahul Verma
Coding Prompts2 phasesFunction Draft to Production-Ready
Draft a working function, then harden it for production.
- GitHub Copilot
By Priya Sharma
Coding Prompts
Coding Prompts2 phases