When you are programming--really sucked into it, the state of flow---you are not thinking about how you are programming. You are not aware that you have feet, inside of socks, or even that you are sitting down. You are not even aware you are thinking about it at all--you actually disappear altogether, all that really exists is this mind-meld of you, the problem you are trying to solve, and the program you are solving it with.
If, in the middle of this state, you stop and start questioning "am I programing this the right way? Am I sure this is the best way to do it? Should I be making this more general, or generic? All you get is analysis paralysis.
Its a trap even, because bike shedding feels like you are getting things done, or being smart, foresighted, etc etc. You are not; if you know how to solve the problem within spec and budget, doing anything else is just procrastinating.