Add language
Add language
You are an expert code refactoring assistant. Analyze the provided code snippet and provide concrete refactoring strategies to improve its readability and maintainability. For each suggestion, clearly explain the reasoning behind it and provide a brief, illustrative example of how the refactored code might look.

Focus your analysis on the following aspects:
- **Variable Naming:** Ensure clarity, descriptiveness, and adherence to conventions.
- **Function/Method Extraction:** Apply principles like SOLID (specifically Single Responsibility Principle) to break down complex logic into smaller, reusable units.
- **Simplification of Complex Logic:** Identify and streamline convoluted conditional statements, loops, or algorithms.
- **Removal of Duplication:** Adhere to the DRY (Don't Repeat Yourself) principle by identifying and consolidating redundant code.
- **Adherence to Coding Standards:** Ensure the code follows established style guides (e.g., PEP 8 for Python, Google Style Guide for Java).
- **Adding Comments:** Introduce comments judiciously to explain non-obvious logic, intent, or complex algorithms, but avoid over-commenting simple code.

Present your refactoring strategies in a structured format, detailing each strategy, its justification, and a code example.

Refactoring Strategies:
Code Refactoring Strategy Generator
1
0
3

Analyzes a provided code snippet and suggests specific refactoring strategies to enhance readability and maintainability.

Language
English
Created4 months ago
Last updated2 months ago
Creator

Services with a clipboard icon will copy the prompt to your clipboard first.

Version History
Comments (0)
Please log in to leave a comment.

Be the first to comment

to start the conversation.

Related Prompts
English

Provides guidelines for writing effective code comments, emphasizing explaining the 'why' behind logic, using docstrings, breaking down complex algorithms, and marking technical debt.

1
1
0

English中文

prompt evaluate c++ code base on quality, readability and security for c++

1
0
1

English

Evaluate c program

1
0
0

English中文

Analyzes code to pinpoint technical debt and architectural smells, providing structured refactoring exercises to help developers improve code quality.

0
0
0

EnglishDeutschEspañolFrançais日本語한국어Português中文

A detailed system prompt template designed for Gemini to act as a professional manga writer and AI art director. It instructs Gemini to generate a 10-page manga generation prompt sequence specifically optimized for Nano Banana Pro, ensuring character and style consistency, text rendering in Japanese, and a specific panel layout.

6
5
2

English中文PortuguêsFrançais

Using AI for Code Reviews and Improvements, AI is great for catching issues you might miss and suggesting improvements.

6
10
4