Not to talk on how it affects thinking, but it most certainly affects dreaming.
I have what I refer to as "recursion dreams", which are never ending code within code within code within code dreams, incredibly disorienting, dizzying, leaves me with a massive headache and migraine in the morning* - but often comes after long stretches of code reading/writing, and sometimes will lead to solving a particular problem I am working on. But, usually, it just means I'm stressed.
I've heard of code dreams, but does anyone else have recursion dreams? I'm going on nearly twenty years of them with them getting more and more complex.