PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #refactoring tag
Refactor code safely and effectively. Common refactorings: 1. Extract Method (long function → smaller functions). 2. Rename Variable (unclear → descriptive). 3. Extract Class (large class → multiple focused classes). 4. Inline Method (unnecessary abstraction). 5. Replace Magic Numbers with Constants. 6. Introduce Parameter Object (long parameter lists). 7. Replace Conditional with Polymorphism. When to refactor: before adding features, during code review, when fixing bugs. Red-Green-Refactor cycle. Use IDE refactoring tools. Keep tests green. Small steps. Commit after each refactoring. Based on Martin Fowler's 'Refactoring' book.
Act as a senior software engineer. Take the following code snippet and refactor it for better readability, performance, and maintainability. Explain the changes you made and why.
I have an old JavaScript codebase that uses ES5 syntax (var, function declarations). Help me modernize it to ES6+ syntax (let/const, arrow functions, classes). Take the following ES5 code and rewrite it using modern JavaScript features.