What was the weirdest (or most awkward) time and place that you've found yourself thinking about a programming problem?
views:
705answers:
22In the toilet, while taking a dump.
Ironically, this always works, sometimes solving problems I've been battling for a few days already.
I guess the silence and solitude helps clear the mind. LOL.
===
UPDATE: Marking this as Community Wiki. Don't wanna gain repu on something as crappy as this!
For me it's when I go to bed.
I'm not even near my code, and I shouldn't be thinking about it anymore, yet sometimes that's where I think of the solution.
That's the classical 3B situation: Bus, Bed, Bathroom
Although the worst of all is getting some solution while going to Bed. You know that you won't be able to sleep at least before jotting it down somewhere.
As a developer with ADD, there are a lot of strange places I think about "inapropriate" things:
- while playing with the kids
- while having diner
- on the bike
- during a game of d&d
- while answering questions on stackoverflow
- while watching a movie
But the winner is definitely reserved for the moments I won't supply any more details.
In my dream. :)
Early on in university I found myself struggling with a programming assignment. After I went to bed I spent the whole night in what I can only describe as a state of half sleep...I was sure I was asleep but I felt strangely conscious as well.
I coded and debugged my assignment all night and barely got any rest.
The weirdest part is that when I woke up I was able to head straight to my computer and solve the problem in a few minutes.
From that day onwards I vowed never to let myself get that consumed on a programming problem again. its better to get a good night's rest and look at the problem with fresh eyes...even if you can solve problems in your dreams..
When I'm asleep, going to the loo, lying in bed awake ... or in fact last night worked something out while at a Carol concert :-)
Snowboarding down Col Du Plan on Aiguille De Midi, Chamonix, France. Had left work a few days earlier with an unsolved issue. I wasn't thinking about it, but the solution just came anyway.
That shouldn't happen, at least not on Col Du Plan.
Not so weird: taking a shower. I've come up with some creative ideas there. The problem is only that sometimes I forget them before I could write them up... argh! :-)
It seems that I'm not alone, Scott Adams (creator of the Dilbert Comics):
Mr. Adams gets most of his ideas while in the shower. The bathroom door is closed when it happens, so there are two possible sources. Either the ideas are contained in the clean, chlorinated water that comes from the showerhead, or they emanate from the public sewer system and waft up through the drain. Judging from the quality of Mr. Adams’ ideas, I think we can rule out the showerhead.
Sincerely, Dogbert
Scott Adams - Dilbert
In addition to the 3Bs mentioned above, the other time I think of solutions to difficult problems is when I'm doing other more mundane coding, which makes the current work even more boring.
At a dinner party with my girlfriends parents...
I actually got an "Are you ok? You seem distracted" by her mother.
My instinctive response was ".. yes.. I'm just thinking... about this problem".
They might think I'm weird.
While my wife was in labour.
This isn't so much "solving a programming problem" as "programming in a hurry" but...
Just over five years ago, my wife went into labour and we found we didn't have any digital watches - just analogue ones which didn't even have second hands. Obviously I helped Holly during the contractions, but then between contractions I wrote a quick and dirty WinForms "contraction timer" which logged the duration of the contractions as well as the time between them. The user interface was a big, easily-clicked button saying "start" or "stop".
I was going to update this to a voice-activated v2 for our second child, but it turned out to be twins - birth was via a C-section, and Holly was in hospital well before the birth anyway, so it wasn't needed. Might write it anyway some time - a friendly application keeping track of things for you is a lot nicer than trying to write down times etc.
When I was on the other side of the world and meant to be on holiday.
I was backpacking around Europe when I came up with the theories that I used an iPod wripper I wrote.
I was away from any kind of computer or anything.
On more than one occasion when I've been ill, I've been lying in bed in a bit of a daze thinking my illness must be some sort of software bug, and if only I could debug my stomach / head / whatever then it would go away.
As for real software problems, I tend to get good ideas while washing up after dinner.
- Middle of a sentence. I stop speaking and then I usually hear a distant "Are you ok?"
- While driving. I put the auto pilot on and always miss my exit.
I've been coding assembly language for VJ visual in discotheques...
So I had to solve programming problems during techno parties after drinking lot's of vodka...
While driving to and from work is where I tend to find myself thinking about coding problems.
Usually while I'm in a queue though as I'm concentrating on the traffic when actually moving. Guess I'm just giving my brain something to do while the car is ticking over and the lack of interruptions must help.
During my sleep. Sounds crazy, but I’ve often found myself writing and compiling code in my head during dreams. Then I awake to an uncannily real answer.
At the symphony. I really like classical music but my mind always wanders and is usually stimulated by music.
While driving home after a weekend in Las Vegas.
Some years ago, I would go to Vegas for the weekend with a co-worker. We'd usually leave San Diego around 7pm and get to Vegas around midnight.
One Friday, I was working on some code and was just baffled by a bug that was crashing the software. While I hate leaving for a weekend with code in that state, we had a trip planned so I left it and we were off to Vegas.
On Sunday night, as we were driving back, it just hit me. I knew the cause of the bug. When we got back to the office where I had left my car, I put in the fix and verified that it indeed worked. Problem solved!
Middle of an empty highway, 3am, on my bike.
The mind does silly things at that time of the morning anyway, might as well put it to good use.
Seconding the dream-thingie.
About 13 years ago (I think?) I was working on a 3d-engine that would render lightwave-scenes in realtime. Somehow the lighting was wrong, and for 2 weeks I couldn't figure out why. I went to sleep on a friday night, dreamt I was coding and spotted the bug. Fixed it and it worked. Then I woke up, got behind my pc, and applied the same fix for real.
Weird stuff :)