Make the model explain its code back to you.

By (@petersturge) ·

I shipped code I didn't understand once. The model wrote a function that sorted and filtered a list, I pasted it in, it worked, I moved on. A week later it broke on a list that was empty, and I sat staring at code I had never actually read, trying to fix a function I couldn't explain. I had outsourced the writing and, without noticing, I had outsourced the understanding too.

Now I ask the model to walk me through its own code before I accept it. "Why did you do it this way? What happens if the list is empty? What are you assuming about the data?" The answers catch things the code alone never shows me: it assumed the list was already sorted, it assumed the user was always logged in, it assumed a field would never be missing. Those assumptions are where the next bug lives, and the model will tell you about them if you ask — it just won't volunteer them.

This is also how you actually learn from the model instead of just using it. When it explains a pattern — why it split the function in two, why it used a map instead of a loop — that pattern stays with you for the next job. The code is the answer to one problem. The explanation is the lesson for the next ten.

If you can't explain a piece of code in your own words, you don't own it yet. Ask the model to explain it until you can.

Explore more on Prompted