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.
Replace {{request}}
with your specific code improvement needs:
Be specific about what you're looking for:
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)
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;
}
The AI will provide: