The prompt
Refactor the code below for readability and maintainability without changing its behavior. Improve naming, reduce nesting, and remove duplication. Keep it idiomatic for the language. Return the refactored code, then a short list of what you changed and why. Code: [PASTE]

More prompts in this discipline

Collected from the Notion template. Want to share one of yours? Submit a prompt.