It has been said multiple times already that one should work in small chunks. I was subjecting myself to such approach since long time. But I think I have never reached level that I have just recently. And surprisingly key factor that led to this is not at all work related – it’s my family situation.
We’ve just got a 2nd daughter! One of practical implications of preceding pregnancy was for me increased work time fragmentation, because of doctors appointments and stuff alike. This naturally means, that the longest time slot that I could work on something was (on average) shorter than in has been before. But that on it’s own was not a game changer.
The actual game changer was the thought, that any minute I can get the “it’s now!” call. This made me organize my work in a way, that allowed to reduce waste in such case. This means that I coded in very small chunks, committing code 8-12 times a day, instead of 4-6 commits/day, as it was before. As it turned out it is still possible to keep every commit relevant to business case and having unique value for solution (I also have to admit, that the project and the tasks allowed it just fine).
Furthermore, if I got any information or came to a realization that could be relevant for the project in foreseeable future I rushed to share it with people around me, so that they could use it independent of my presence.
If you think about it it’s really paranoid approach. The one moment that is unavoidably coming is affecting weeks/months of work-style. But this is something that I will try to keep doing, accidental improvement if you will.
One more thing to keep in mind: committing must be fast not to destroy the flow.