|
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.
|
|
|
|
|
Some of the other answers have hinted at this as well. It's not just about "in your sleep", but "when not working."
Just getting away from the problem for a bit often sparks an insight in the back of your mind. Go around the block, fiddle with another bug, whatever to gain a fresh perspective.
|
|
|
|
|
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
|
|
|
|
|
Nice description.
I agree
M.D.V.
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.
|
|
|
|
|
Turns out the body's natural response to prolonged sleep deprivation (or highly reduced sleep -- I was getting around 2-3 hours a night for 6 months) is seizure.
So, imagine, if you will, being in a shop in a busy mall, attempting to play a video game on display against a friend, feeling rather odd and coming to with paramedics sticking stuff into your arm.
Take it from this old fart -- please get some sleep (7-9 hours a day). You'll code better and (probably) live longer.
|
|
|
|
|
I wonder how you managed to accomplish that for so long... I think by the third day I would just pass out for 10 hours minimum.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
Davyd McColl wrote: I was getting around 2-3 hours a night 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
Which is stupid.
|
|
|
|
|
...on the job. Otherwise I'd never solve anything when most of my software solutions come to me in my sleep.
Brings new meaning to "I can do this in my sleep".
It was broke, so I fixed it.
|
|
|
|
|
|
the eureka moment came whence I have departed work!
|
|
|
|
|
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.
But I never wave bye bye
|
|
|
|
|
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.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Often when on the toilet.
I guess there's very little distraction in the bathroom giving me some time to think about my (programming) problems.
|
|
|
|
|
Sander Rossel wrote: Often when on the toilet. REQUIRED COMMENT ! You know you wanted this !
. . . and that speaks volumes about the quality of code your write !
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Quote:
. . . and that speaks volumes about the quality of code your write
Hey, it's VB code. What do you expect from him. Smell!
|
|
|
|
|
I try to not do VB, but it sometimes comes back to haunt me!
Anyway, MY VB code is as good as my C# code
|
|
|
|
|
Spent weeks trying to understand how the **** it worked and then I woke up in the middle of the night after having dreamt about the subject with an Eureka! moment.
Sometimes night brings counsel.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
In school, when I got stuck in Physics or Math problems, sometimes the solution would come to me while dreaming about it (yeah I had no life ).
In college same thing will happen but for tough dark souls bosses or burnout paradise races (I found a shortcut while dreaming about a race).
And now, yeah programming problems.
If only I could solve other mysteries as well .
|
|
|
|
|
I take "sleep" as unconscious...
May be walking, driving, doing something else than coding.
Amit Joshi
Value of the value is valued only if its value is valued.
modified 2-Mar-20 0:56am.
|
|
|
|
|
OMG! You are unconscious while driving!! Be careful that you could have ended up vegetative state or deep coma after an accident.
modified 2-Mar-20 3:17am.
|
|
|
|
|
Haha... Wrong choice of word.
Any situation when I am not explicitly thinking about coding/problem.
A time when I am not conscious ( ) about the coding/problem.
Amit Joshi
Value of the value is valued only if its value is valued.
|
|
|
|
|
Technically that would make him unconscious again, which would lead to even more coding solutions.
My plan is to live forever ... so far so good
|
|
|
|