Code as Craft
Why I still care about the details
There’s a certain kind of programmer who will spend an extra hour naming a variable correctly, even when they’re the only one who will ever read the code. I’m one of those people, and I’ve been thinking about why.
Part of it is aesthetic—ugly code makes me uncomfortable in a way that’s hard to justify rationally. But I think there’s something else going on too.
Writing code carefully is a way of thinking carefully. When I take the time to find the right name for a function, I’m forced to understand what it actually does. When I refactor a messy conditional into something cleaner, I often discover bugs I didn’t know were there.
“The code you write makes your mind a certain way. Care about the code you write.” — Someone, probably
The craft is the thinking. They’re not separate activities.
This probably sounds precious to anyone who’s shipping under deadline pressure. And maybe it is. But I’ve noticed that the code I wrote carefully tends to age better than the code I rushed. Future me is always grateful.