Not sure what the $15 word is for this but I have solved many coding problems with the solution "popping" up in my head randomly and instantly. Usually a few hours or more after consciously thinking about the problem at hand.
Almost always is the correct solution too. weird.
It's much easier to enjoy the favor of both friend and foe, and not give a damn who's who. -- Lon Milo DuQuette
In busy projects I occasionally do solve complex problems in my sleep, but usually my dreams don't get as detailed as that. So I think its daydream time more.
Genuinely the number of times I make my best decisions when I take a "rest break" I couldn't count.
It does seem most frequently to be a trip to the toilet, but same can be said for taking a 5 minute seat on the comfy chairs our office has in common areas. Common factor is it is not long away from the problem, and peace and quiet (the coffee area is not good, people ask you things, you know social stuff ).
Got a recommendation for a book from Chris on how important sleep is. Yes, I dreamt about solutions. In C# and in bread. I read that book, but can't remember reading it at all.
You need sleep to be creative the next day. If you don't, you need still sleep to not react like half a zombie. If you don't again, you loose sanity. You start hearing things first, then you start seeing things.
Day four you hear stuff, day five you can "see" spiders on your walls. From day four, the damage is permanent and cannot be reversed.
Sleep on it. You need it, even if it doesn't bring a solution. It's not important enough to keep you awake. Hardly anything is.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
I think problem solving in my sleep works similar to a OS update:
You have all the required knowledge downloaded before going to sleep.
As you try to go to sleep, brain needs to power off a bunch of activities,
Sleep is like a low power state. some brain refactoring, but not much heavy active processing.
When waking up, the brain then really starts some stuff, the dreaming that happens just before waking.
Updates applied and start running, making changes.
That eureka moment is not special, its just the updates that you had ready before sleeping now running more optimised due to clearing out other active processes
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
Not a good idea. Explanations as to why we need to sleep were mostly hand-waving. But it was recently discovered that, once you enter the right phase of sleep, spinal fluid circulates throughout the brain, cleaning it up. A lack of sleep could therefore contribute to Alzheimer's and other forms of dementia.
Yeah, I'm well aware, but this was also around 2002 or so, when the recent science hadn't been scienced yet! I just wanted any young 'uns who come across this to realise that long before Alzheimer's in old age, you're likely to seize if you avoid sleep for prolonged periods. It's apparently a normal response.
If you say that getting the money is the most important thing
You will spend your life completely wasting your time
You will be doing things you don't like doing
In order to go on living
That is, to go on doing things you don't like doing
When I lay down to sleep but before I am actually asleep - I call this twilight time.
I recognized a problem in the hex stream of the socket return... (in client from call to server)
I immediately wrote the solution on a scratch piece of paper I keep on the night stand.
Unfortunately when I woke up the next day, what I wrote looked like chicken tracks.
On the ride in the next day the solution came back to me.
The team writing the server code, which I had never seen, were amazed when I told them the method and offset in the server code with the problem.
Being (most fortunately!) a morning person, by mid to late afternoon I might find myself running in place with a problem. Almost invariably, the view the next morning makes all things clear - often with an "Oh. Yeah".
It does happen, however, that when trying to fall asleep the preceding evening I will find my head dwelling on in (of its own accord and without my permission) and also hitting upon the answer. Also happened whilst napping on the beach.
Now some might attribute this in themselves, as we're all won't to do, that the break allows a new perspective. The dream state lifts bounderies. The actual answer can be summed up in a single word: Homunculus.