asking an AI coding assistant to review code

The answer I’d be most careful with is “looks good.” It’s easy to read that as permission to stop worrying, especially when you’re tired and just want to ship. If I’m asking an AI to review code, I’d want to give it the reason for the change too. “Review this function” leaves out things like whether an empty result is acceptable, whether old clients still need to work, or whether the same request might arrive twice. Code can look perfectly reasonable while doing the wrong thing for the product. I’d also ask it to review before editing anything. I want a chance to understand the concern before getting a rewritten version of half the file. Sometimes an awkward bit of code exists because of an awkward requirement. A prompt I’d use: “Here’s what this change should do. Read the surrounding code and tell me what I might have missed. Leave the files unchanged, skip style preferences, and say where you need more context.” I don’t need it to find ten things. One useful question that makes me check something I’d overlooked would be enough.

↑ 0 net votes☆ save · 0Report entry

The most useful review comment is one you can turn into a failing example. What input causes the bug? What permission is missing? Which assumption breaks? Without that level of detail, a long list of suggestions can make a patch look reviewed while leaving the important questions untouched.

↑ 0 net votes☆ save · 0Report entry

Add your experience to this topic.

Sign inCreate an account