LLMs don't understand my code, cuz I didn't comment

3 fdlinly 1 6/20/2025, 11:36:07 PM
Wanted to share this small but mighty lesson with y'all. I wrote a clever code to solve a problem using a greedy approach, and had GPT and Gemini and Claude to review it. Gemini said my code is functionally correct but the logic isn't right. The other two LLMs said my code was wrong. Even though my code has correct output for all of the test cases they came up with. Ok, glad I was confident enough in myself, and went through my logic again, and started ADDING COMMENTS! Now, they finally got it and all said it's a smart approach and 100% correct.

Lesson? Always comment on your code! Not just for your future self, but also for the LLMs (and the enviornment - since we won't continue the back and forth to waste inference costs.)

Comments (1)

coldtea · 4h ago
>Now, they finally got it and all said it's a smart approach and 100% correct

Did they "get it", or did they just say it's correct, without having a similar level of not getting it as before?