Besides dreaming of coding I solved several problems in several areas like calculus and physics.
I love physics a lot and once I dreamt that I time is three dimensional . Since I have one type of narcolepsy (no I don't fall asleep all of the sudden) I have a very unique characteristic of this condition which is to have lucid dreams.
So I remember very well about how I came up that time is three dimensional, except for some details. I just wish I had more resources so I could research it for real, because it was really, really cool.
It's much more likely to be bogus though
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
I have woken up in the middle of the night in a panic because I am stuck in a "for" loop that will not exit.
I get up to releive myself and only then do I finally wake up enough to realize that the programming loop does not exist and it was only a dream.
When I was teaching a beginning Windows programming course many, many moons ago, I had a study that was dreaming about coding. Then his alarm clock went off and he spent time in the dream looking for the handle to the alarm clock object so he could call the snooze method on it.
That sounds precious - but what I mean is that when I dream like this, it's a strange dream programming - I never dream of programming. I recently dreamed that my son was crying and that I was running some sort of blended patch programming language (like MAX/MSP or Quartz Composer) to fix what his problem was.
I also vaguely remember a dream where I was adding something to my house with code.
Stuff like that. It's always a little frustrating to wake and realize that what I dreamt was impossible (at least for now )
"the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011) "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)
"It is the celestial scrotum of good luck!" - Nagy Vilmos (2011)
"But you probably have the smoothest scrotum of any grown man" - Pete O'Hanlon (2012)
It happened to me often that I found solutions to programming problems when dreaming or just dozing. I don't really think that this is such an uncommon thing to happen. Indeed I also believe that a lot of work is done by our brain when we are not conscious. Sleep deprivation experiments have shown that we need sleep in order to function properly, albeit some need more than others, and it is not only about giving the body a rest, but also sorting things out in our mind. Lets call it post-processing and a little garbage collection.
That is part of the reason I deliberately take a five or ten minute break from development pretty much every hour. Doing something unrelated to the task at hand helps to focus me on the essentials of the task, rather than the details of the problem I was trying to solve. I often find that when I pick it up again, I have a clearer view of what I am trying to do, and can work a lot more effectively.
I know it sounds odd, but not doing my job all the time makes me better, and more efficient at doing my job!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
This is very common and integral to how brain works. Brain does lot of its work in dream/sub-conscious state. Sometimes it is in an actual dream you can remember and sometimes you see that you know the solution to a problem as soon as you wake up from sleep/nap.
Yes at times I have that feeling too. I cannot quite describe it how it happens but at times the problem that I try to solve is too complex and cannot find a way around after trying several ways and often when all I wanted to do was give up on it and magially in my dreams I figur out how to solve it. That feeling is really magical.
Zen and the art of software maintenance : rm -rf *
Math is like love : a simple idea but it can get complicated.
My wife claims that I elbowed her in the ribs at 2am and said "Give me the CRO."
I was fast asleep at the time.
In the morning, I had to explain that it must have been CRO (oscilloscope) not anything else she might have imagined.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
Once I had a persistent sore throat and I dreamt that I was delving into the code of my mind to see if there was perhaps something wrong with the 'IsThroatSore()' interface function rather than the actual 'Throat' object.
I was investigating a way to add more interface functions to more accurately diagnose the source of the problem but I woke up before I had finished
I'm actually a bit surprised, now that I think about it I don't think I ever have. Which is odd, pretty much any other regular activity has made its way into my dreams, including using a computer to browse the web, but never programming. And on top of that my dreams are generally heavily influenced by things I've done/seen/etc. in the past 24-48 hours...
And I thought I was the only one. On high-stress projects I dream about possible solutions so much that often I wake up screaming "yes, solved it". After which I reach for my pen and paper on the night stand.
In my dreams the computer is usually behaving erradically. The debug cursor is jumping around or the screen is going black at random. Sometimes it may even talk to me (via console).
And that helps me to figure out that I'm dreaming and I enter lucid dream
After fixing a bug and before starting full scale testing, I always spin the totem (just like Dicaprio in the movie Inception)
And you know what, most of the times it will be spinning endlessly - Bad Totem
Usually if I have a problem bugging me I just won't go to bed until it's solved.
This isn't always possible but I prefer spending a couple more hours on it than putting it on hold 'till the next day.
Then another rule of thumb I have kind of contradicts the previous:
If it takes more than a couple of hours to figure it out then it's better to put it on hold.
It's amazing how our brain can find solution to problems when we're not strictly thinking about them.
When intaking a new language I find I dream about the bloody syntax, almost always end up in a perpetual loop, wake up and end up grumpy for the entire day. The wife hates it when I'm in a learning phase.
Once I get the syntax settled it is only coding problems that wake me, usually about 4am, thankfully I always seem to be able to remember the details the next morning.
Never underestimate the power of human stupidity
Moral of this story is:
Don't involve in coding related activities after heavy and spicy dinner - both will haunt while asleep and vulnerable!
Subconsciousness can act like a tricky bastard.
if i have worked on some complex code repetitively over the day, i dream that i am debugging code.
But sometimes mind helps to find solution when you are not actually working and doing other things(like getting cup of coffee, using lift or simply visiting the cafeteria) and thinking about code , an idea pops up in mind.
Yes, at times it does work that way
Simply put the problem to hold if you have already spent more than a couple of hours fixing it... take a break, may be a long one, and it may get solved with a fresh and relaxed mind
Imagination is the one weapon in the war against reality!!!