When programming you have to keep a lot of things in your mind simultaneously. It's a kind of multi-tasking actually - but all in your mind.
You write it down - some of it - but can't write it all down. So - it's like - for most people multi-tasking is something they do externally - juggling several physical things at once, maybe talking to several people etc.
But when multi-tasking in your mind - it's all going on internally. I think it is very similar actually.
We all do multi-tasking, the idea that only women do it is absurd. Just things like talking while you walk, or looking around while you walk - that's multi-tasking also. And often many things at once. You may be crossing a road, talking to someone, checking the traffic, walking, and may have some thought that you are working on that you have in your mind as well, not in the forefront.
So - I think it's to do with that - a transition between the multi-tasking happening internally, and mainly to do with abstract ideas like lines of code, and structure of the program and ideas for why something isn't working - a lot of the time you are thinking as much about why something isn't working as about how to do something new.
So - then you have that transition to external multi-tasking. And you don't do the external multi-tasking well because you are still trying to juggle things internally and get absent minded, just through habit, for a while. Could just be a few minutes could be longer transition, could be you get "in the zone" for hours or days even.
I find myself anyway - that when I'm deep in some programming task, is a tendency for my life to become more disorganized in other ways. And when i tis over, I then take stock of things and - it's like you begin to notice the external world more.
Partly - attention also I think. Not so much that you ignore responsibilities or forget them, as - you are almost like in another world and don't see them.
Another thing that's a bit like it - is reading a book - like you are totally immersed in a compelling story. And - just for a second or two, if you interrupt someone who is in the middle of a good read - they may be a bit absent minded and abstracted because they are still engrossed with the story. Listening to music can be like that also watching films, sometimes.
Like that but somehow much more so.
It's not really that you are running lines of code through your mind or anything like that. It's more like you are in a transition state, like someone waking up from a dream, or someone emerging from a good story or a film - you may be good at letting go of your work so you aren't continually thinking about it outside of your work - but still the "world of coding" somehow fades away in a slow transition rather than instantly.
I'm a mathematician - and maths is like that also - but for me anyway - it's easier to go in and out of the maths world in a way - faster transition more like the transition after reading a good book - while there is something about programming that really catches your mind more even than for maths.
If one has strong tendencies like that - you can do stuff about it - like - finding activities that are very much in the external world that take up an hour or two each day. Those can also be good for the programming too - they may be times when problems "solve themselves".