I think this is the first time I’m confessing here: for months1 I’ve been working on fiction2 for hours a day. This wasn’t intentional. I am, however, pleasantly surprised at the knock-on effects.
Readable organization transcends genre
The following sentences contain the same information content:
- I ate, with the intention of satiating myself, a cake.
- I ate a cake with the intention of satiating myself.
That’s a legal place to put the clause. It’s also a terrible one. Verbs (“ate”) should be near their objects (“a cake”).3 I always have to carefully re-read my own writing to fix these sorts of issues.
Or, I previously had to. I now find that my first drafts are already better at this. My sentences come out with verb-object proximity on the first try. If not, then I see the problem immediately and can quickly go back and fix it. In general my sentence constructs are smoother.
“Great”, I hear you saying4, “but that ain’t code. Isn’t this a blog on writing code?”
Code also needs a logical flow. The problem has an analogous shape. Plus, take comments. Comments are regular, theoretically readable prose. Thus needing readable organization.
The first time is never perfect
It staggers me, the sheer amount of time I have spent editing the same words over and over5. I recently finished a first-pass edit through the latest piece. A “structure edit”. Very much structure needed to be edited. Things seemed fine during the first draft. But with some space, and a greater understanding of the whole, I found plenty of spots that could use a nudge.
Nothing is its best version on the first go-round. That goes for code as well as fiction.6 It will always benefit from editing. I can be lazy about this, but the stark lesson of just how much I’ve edited my fiction (and how much it improved) is motivation to put more time into editing my own code.
Other people are weird
Oh, hey, it’s another lesson that I already knew. And one that I’ve drilled here several times already. Still worth emphasizing. Other people are weird. They believe weird things. They hold weird assumptions. They’re going to read my code and come out not understanding things that I think are utterly obvious.
It got easier for me to reflexively remember this once I’d spent months inhabiting the mental worlds of people who aren’t me. Especially multiple people who aren’t me, and who think differently than each other.
I realize this sounds twee. Sometimes reality is, in fact, twee.
- Since 12th July and without a single full-day pause in that time.
- Fanfiction posted under a pseudonym. No, I am not linking it here.
- From Writing science in plain English by Anne E Greene.
- In my fevered imagination where these are read by anyone other than scrapers.
- My beta reader would like me to go faster.
- Especially if the code is LLM-generated, m’kay?