Name it like you'll read it at 2am.

By (@ezech) ·

The model wrote me a function called `doStuff`. I let it through because the code worked, and working code felt like the whole job. A week later the app broke at midnight, I opened that file half asleep, and I had no idea what `doStuff` did, what `data2` held, or why `temp` existed. I had to read the whole function line by line to find out — at 2am, with the app down — and the bug was a one-line fix I would have spotted in ten seconds if anything in that file had told me what it was for.

Names are the only documentation that never goes out of date, because they sit right where the code runs. A comment can lie — someone edits the code and forgets the comment — but a name that says `calculateTotal` cannot quietly become something else. When the model picks a vague name, it is not being lazy, it is copying you: you said "make a function", so it made a function, and `doStuff` was technically correct. The model will name things as clearly as you ask it to, and no clearer.

Now I put the name in the prompt before the job. "Write a function called `validateEmailFormat` that takes one string and returns true or false." Then the model has to think about what the thing is before it writes it, and the name comes out honest. If I catch a `data2` or a `temp` in the code it hands back, I ask for a rename in the same prompt, not later — later never comes, and 2am always does.

Good names cost nothing and save the worst hour of the week. Name it like the person reading it is tired, stressed, and has forgotten everything — because one day that person will be you.

Explore more on Prompted