Hacker News new | ask | show | jobs
by seunosewa 28 days ago
You can just ask the model to explain the code to you.
2 comments

Yes, and you will still not understand as well as if you had built it.
You're similarly not limited by what you can readily understand.

Being comfortable with the default level of trust is one thing. Command of the code is another.

By running the generated code at all, you've found some acceptable level of trust and comfort.

Scaling that comfort and trust seems to be the obvious move.

We often don't understand the code we wrote 6 months ago.
For me, the issue is that the model can explain what the code IS, not what it’s supposed to be or aspiring to be. The code doesn’t explain the original constraints (because it already fits within them) and it doesn’t show the tried and discarded approaches. It’s like rewriting a MIDI roll back into sheet music. Or better, it’s like the difference between being the author of an opera, and having read reviews of it.
One of my favourite things to do is to ask the models, "what does this code do and why?" They are usually not far from the truth. From the perspective of a LLM that has been trained on all of the public code on GitHub, issues, and pull requests, your code and its intents are not that unique. They can see patterns in the code that point to the purpose. The constraints that shaped your code are the same constraints everyone else had.

Developer intents and aspirations aren't unique either. And in an LLM-written codebase, the chat history and prompts are available. The constraints, the rejected approaches, the goals. Users ask the models to write MD files that directly state their intents and aspirations for the ode.