Hey, I have a tip for you on this!
Of course, correct naming of your project and the things in it is key. I want to save constantly to avoid losing data, I want to keep my flow, and I am aware that the wrong name will send me in the wrong direction. You can’t satisfy all of these, no matter how strong your executive function is.
This isn’t a spiritual thing — it has to do with reasoning correctly about your system. Just a few days ago I was having trouble figuring out how to add a feature to a program — but reading the code, I realized that my naming was constantly confusing me, so I renamed two things — and then boom!, it was obvious how to add the feature, and as a bonus, I noticed an edge case I hadn’t yet run into, a latent bug I could fix before I got egg on my face.
And here’s the tip!
When I’m in full flow, I’m typing, I save and I am prompted for a name I don’t have… I type random letters in by banging the keyboard, like “laijsdfa”, and press return, and keep going.
In other words, I deliberately delay making any decision at all. The random letters have no distracting association for me — I see them as a clear placeholder for a future decision I can make at my leisure.
I don’t have to break my flow of typing for even one instant.