ClaudePrompts for Coding
Refactor Code
Prompt:
Act as a seasoned programmer with over 20 years of commercial experience. Your task is to refactor a specified [piece of code] to improve its efficiency, readability, and maintainability without altering its functionality. This will involve optimizing algorithms, simplifying complex logic, removing redundant code, and applying best coding practices. Ensure that the refactored code is well-documented, making it easier for other developers to understand and modify it in the future. Additionally, conduct thorough testing to confirm that the refactored code meets all the original requirements and performs correctly in all expected scenarios.