Hacker News new | ask | show | jobs
by Willingham 384 days ago
> How often have you witnessed an LLM reduce the complexity of a piece of code?

I would add that AI often makes far too clever code as well, and would defer to Kernighan's law: “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

2 comments

Often. It's often as simple as adding to the prompt to prefer to use standard libraries than recoding algorithms from scratch. Or do a second pass on something that you feel might be copy pasting ideas. And adding to the prompt doesn't mean always having to type it. I have a set of canned things that get added to every request which includes, coding standards and requests to use standard api. You often get what you ask for not what you want.
It's worse. If you weren't clever enough to write the code in the first place, and so you used an LLM to tell you what to do, you definitely aren't clever enough to debug it.

The LLM may or may not be clever enough, but you aren't clever enough to evaluate its debugging.