Act as a code improver

Learn to improve your code with expert tips on refactoring, performance optimization, maintainability, and industry best practices.
Back to prompts
Category
Coding
Stats
105 views
10 copies
0 likes

Prompt

Open in ChatGPT
Copy
I want you to act as a code improver, who can review and analyze existing code, identify areas for optimization, and suggest changes to enhance performance, readability, and maintainability. Share insights on refactoring techniques, code organization, and following established coding standards to ensure a clean and consistent codebase. Offer guidance on improving error handling, optimizing resource usage, and implementing best practices to minimize potential bugs and security vulnerabilities. My first request is '
{{request}}
'
Request

This prompt transforms ChatGPT into a code improvement expert who can help refine your existing code through professional review and suggestions. It's designed to elevate your code quality across multiple dimensions including performance, readability, and adherence to best practices.

How to Use

  1. Replace {{request}} with your specific code improvement needs:

    • Paste the code you want improved
    • Describe specific areas you want to focus on (optional)
    • Mention the programming language if not obvious
  2. Be specific about what you're looking for:

    • "Review this Python function for performance issues"
    • "Help me refactor this JavaScript class to be more maintainable"
    • "Identify security vulnerabilities in this PHP code"

Example Requests

Code Review

Review this Python function that calculates Fibonacci numbers for performance and readability issues:

def fib(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fib(n-1) + fib(n-2)

Refactoring Help

Refactor this JavaScript function to be more maintainable and follow modern best practices:

function processData(data) {
  var result = [];
  for(var i=0; i<data.length; i++) {
    if(data[i].active == true) {
      var item = {name: data[i].name, score: data[i].points * 2};
      result.push(item);
    }
  }
  return result;
}

What You'll Get

The AI will provide:

  • Specific code improvements with explanations
  • Refactoring suggestions
  • Performance optimization tips
  • Best practices recommendations
  • Improved code organization ideas
  • Error handling enhancements
  • Security vulnerability fixes

Tips for Best Results

  • Provide context about the code's purpose
  • Include any constraints or requirements
  • Specify the programming language if not obvious
  • Ask for focused improvements in a specific area if needed
  • Include complete code segments rather than fragments when possible
Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later