Comment by RankingMember
Comment by RankingMember 2 days ago
I'm very impressed by (and jealous of) anyone who can context switch fast enough to make use of 10 or 15 minutes here and there to do a completely different task (and actually have it be coherent).
I wrote both "Game Programming Patterns" and "Crafting Interpreters" largely in chunks around half an hour between work, parenting, and other life duties. Likewise lots and lots of hobby programming projects.
Context switching is a skill that gets easier the more you practice it, just like any other. There are techniques like leaving good notes to yourself to pick back up where you left off more easily, but a lot of it just mental training. You sort of learn to hold some of the context in your head all the time but keep it idle when you aren't using it.
When I'm hacking on a hobby programming project, I can often fix a bug or tweak a small feature in fifteen minutes, make a commit, and get a little serotonin hit, all while I'm waiting for the wife and kids to get ready to leave the house.
It doesn't always work for all kinds of tasks. Sometimes for more challenging stuff I really do need a larger chunk of time to load it all in my head. But you'd be surprised how easy it is to eat an elephant one tiny bite at a time if you really try.