Hacker News new | ask | show | jobs
by rspeele 10 hours ago
Even if you have a moral opposition to a single line of LLM-generated code marring your codebase (not even unit tests!) it can be incredibly useful to assist with reading code.

Take a complex, sophisticated codebase you wrote, that only you have deep understanding of, and throw Codex or Claude at it and ask it questions. How does the Foo work? What happens if the user tries to Frozzle a Bar? Give me a guided tour of how the Baz feature was implemented, top to bottom of the stack.

Personally, I was amazed at how accurate the results were, on a codebase where I knew the answers already. Try to pretend that's not a useful tool to use when you have to fix bugs or add features to a large codebase you aren't already familiar with.

1 comments

> Try to pretend that's not a useful tool to use when you have to fix bugs or add features to a large codebase you aren't already familiar with.

how will I know the answers are accurate?

You take advantage of the property that verifying / sanity-checking an answer is usually much easier and faster than figuring out the answer in the first place.

It's similar to how Google has been useful for the past few decades despite the internet being full of junk info. Except Google could only provide semi-reliable information about stuff that's public knowledge with lots of people talking about it, whereas Claude can provide semi-reliable information about your own code that nobody else has ever laid eyes on.

A few months ago I used this to re-acquaint myself with code I myself had written back in 2017-2018[1]. I wanted to add some new features, and I did NOT want AI to write them, because the existing codebase was my own sweat and tears and running it through the slop extruder would cheapen that original work. I wanted to write all the code myself with full understanding of what was going on. Now, it had been many years and the codebase did some pretty esoteric stuff. I was the only person in the world who ever knew what that code did, and I didn't know it like the back of my hand anymore. Particularly the stuff with runtime CIL generation for result set processing.

I did a lot of reading my own code and a lot of thinking about it to get that understanding back, but it was a very helpful tool to be able to bounce my questions off an agent during the process and then investigate its answers for accuracy. And greater than 90% of the time its answers turned out to be correct.

[1]https://github.com/fsprojects/Rezoom.SQL