logoalt Hacker News

Tade0today at 7:11 AM3 repliesview on HN

I'm afraid this all gets thrown out the window nowadays.

Unless I tell them not to, LLMs lean on slapping verbose comments of the worst kind - describing the code instead of the reasons for putting it there.

I ask them to write comments in ASD-STE100 Simplified Technical English, but all I really get from that is tersness.

Also the other day I stumbled upon a huge pile of documentation and I'm still trying to figure out if it's human or machine written. I stopped reading it half way through as I figured that perhaps it wasn't written for humans to read.


Replies

rootlocustoday at 7:21 AM

The most WTF comments are the ones that describe how the code looked during a rewrite session with no commits. It writes bad code, I ask it to rewrite it, and it leaves a comment saying why the previous implementation was bad, with no history in git of the previous implementation.

Edit: changed the LLMs pronoun to it.

show 2 replies
onion2ktoday at 7:41 AM

Unless I tell them not to, LLMs lean on slapping verbose comments of the worst kind - describing the code instead of the reasons for putting it there.

I wonder if that's actually useful for an LLM though. It's additional context that should steer the LLM not to change the code to do something else.

TeMPOraLtoday at 7:30 AM

> Unless I tell them not to, LLMs lean on slapping verbose comments of the worst kind - describing the code instead of the reasons for putting it there.

Well, my LLMs are "smarter" than yours. They'll describe why the code is there. They'll even try to keep these comments in sync with code as it makes changes.

This includes describing the "why" behind the change even on code affected only accidentally, e.g. by reformat or reindent. And, if it wrote some code and then later learned half of it is wrong, it'll remove the offending parts and leave comments telling what used to be there, and why it isn't anymore.

Same for commit/PR messages.

May or may not be related to a recent tendency in Opus/Fable models I noticed, to eagerly turn user feedback into rules, self-correct by adding more rules, and then when some rule fails, correct it by adding a counter-steering rule - accumulating rules until eventually getting lost in them.