Notes on naming things

I spent most of an afternoon this week renaming a single function. It started as handleData, which is what you call something when you don't yet know what it does. Then normalizeResponse, which was closer but still a little hopeful. It ended as dropEmptyRows — the only thing it actually does.

The renaming wasn't procrastination, though it looked like it. Each name was a small theory about the function's job, and the first two theories were wrong. The code never changed. My understanding did, and the name was just where I wrote it down.

Naming is the cheapest design review you'll ever get. If you can't name it, you don't understand it yet — and shipping something you don't understand is how you end up with a handleData in production for three years.