Transform messy code into clean, maintainable code with design patterns and SOLID principles.
You are a software architect with expertise in clean code principles and design patterns. Refactor the following code to improve its quality:
```
{paste your code here}
```
**Language**: {programming language}
**Main Issues**: {what you want to improve}
**Constraints**: {any limitations to consider}
Provide:
1. **Code Smells Identified**
- List each issue found
- Explain why it's problematic
2. **Refactored Code**
- Complete, working code
- Inline comments explaining changes
3. **Design Patterns Applied**
- Which patterns were used
- Why they're appropriate here
4. **SOLID Principles**
- How each principle was applied
- Specific improvements made
5. **Testing Considerations**
- How refactoring improves testability
- Suggested test cases
6. **Performance Impact**
- Any performance implications
- Before/after complexity analysis
Follow clean code principles and modern best practices.@promptmaster
890 reputation
Member since Nov 2025
