top | item 44882629

(no title)

lpa22 | 6 months ago

One of the most helpful usages of CC so far is when I simply ask:

"Are there any bugs in the current diff"

It analyzes the changes very thoroughly, often finds very subtle bugs that would cost hours of time/deployments down the line, and points out a bunch of things to think through for correctness.

discuss

order

GuB-42|6 months ago

I added this to my toolbox in addition to traditional linters.

My experience is that it is about 10% harmful, 80% useless and 10% helpful. Which is actually great, the 10% is worth it, but it is far from a hands off experience.

By harmful I mean something like suggesting a wrong fix to code that works, it usually happens when I am doing something unusual or counter intuitive, for example having a function "decrease_x" that (correctly) adds 1 to x. It may hint for better documentation, but you have to be careful not to go on autopilot and just do what it says.

By useless I mean something like "you didn't check for null" even though the variable can't be null or is passed to a function that handles the "null" case gracefully. In general, it tends to be overly defensive and following the recommendations would lead to bloated code.

By helpful I mean finding a real bug. Most of them minor, but for some, I am glad I did that check.

LLMs complement traditional linters well, but they don't replace them.

csomar|6 months ago

> it usually happens when I am doing something unusual or counter intuitive,

That’s usually your signal that your code needs refactoring.

KTibow|6 months ago

I'm surprised that works even without telling it to think/think hard/think harder/ultrathink.

aurareturn|6 months ago

I do the same with Github Copilot after every change.

I work with a high stakes app and breaking changes cause a ton of customer headaches. LLMs have been excellent at catching potential little bugs.

bertil|6 months ago

That matches my experience with non-coding tasks: it’s not very creative, but it’s a comprehensive critical reader.

elcritch|6 months ago

Recently I realized you can add Github Copilot as a reviewer to a PR. It's surprisingly handy and found a few annoying typos and one legit bug mostly from me forgetting to update another field.

swyx|6 months ago

maybe want to reify that as a claude code hook!

hahn-kev|6 months ago

We use Code Rabbit for this in our open source project.

neucoas|6 months ago

I am trying this tomorrow

lpa22|6 months ago

Let me know how it goes. It’s a game changer