THIS is how it's done. This is a masterclass in how to effectively use LLMs for such things. Providing proper context (Goldilocks -- not too much, not too little), asking targeted questions, and then continuing with intelligent dialogue with the LLM.
I've had several similar examples where LLMs have significantly augmented my workflow, but none so clean and encapsulated (and beautifully explained) as this example.
Interesting, but note that the first bug pointed out by Claude is probably a false positive.
In the original version of the code, if a link is removed and it is the last link, then the condition `remove_idx == worst_idx` must be true, which leads to falling back to the most general update function, which handles the case of an empty list correctly.
(Of course, the suggested fix doesn't hurt, and people may disagree about which version of the code is clearer.)
To paraphrase Rowling, LLMs are rather cleverer than most software, and so their mistakes tend to be correspondingly cleverer. The trick is to ensure that their mistakes don't become correspondingly huger.
I found that Claude has really studied the Redis code base which has one of the highest comment to code ratios I have ever seen outside of a literate program.
IMO, there aren't enough videos of watching people work, esp in programming. I learn something every single time I peer over someones shoulder and watch them code.
THIS is how it's done. This is a masterclass in how to effectively use LLMs for such things. Providing proper context (Goldilocks -- not too much, not too little), asking targeted questions, and then continuing with intelligent dialogue with the LLM.
I've had several similar examples where LLMs have significantly augmented my workflow, but none so clean and encapsulated (and beautifully explained) as this example.
Thank you, Salvatore!
Interesting, but note that the first bug pointed out by Claude is probably a false positive.
In the original version of the code, if a link is removed and it is the last link, then the condition `remove_idx == worst_idx` must be true, which leads to falling back to the most general update function, which handles the case of an empty list correctly.
(Of course, the suggested fix doesn't hurt, and people may disagree about which version of the code is clearer.)
To paraphrase Rowling, LLMs are rather cleverer than most software, and so their mistakes tend to be correspondingly cleverer. The trick is to ensure that their mistakes don't become correspondingly huger.
Very exciting to see this. I was already excited when antirez said he was going to record these.
I found that Claude has really studied the Redis code base which has one of the highest comment to code ratios I have ever seen outside of a literate program.
IMO, there aren't enough videos of watching people work, esp in programming. I learn something every single time I peer over someones shoulder and watch them code.