« Gillmor's Groove | Main | Crazy Poopin' Bird »

Tuesday, October 03, 2006


Feed You can follow this conversation by subscribing to the comment feed for this post.

OK, Jack's "hint, hint" over in my most recent beta thread makes a LOT more sense now... :) :)

I've certainly had a lot of experiences like this when coding. I've had programming solutions suddenly pop into my head during conversations, showers and I've even dreamt a solution once.

I made up an analogy about this years ago, using little people with flags... stay with me. The conscience needs to know something, so gives the job to a guy with a flag, who runs off and looks it up (or works it out). When he's got the answer he comes back and waves his flag. But if you're distracted or busy then the chap with the flag doesn't get noticed. However, when you've got nothing better to think about, and you're staring around blankly, suddenly you spot the flag and get the answer.

Well, it works for me.

I've had the same experience a number of times; I'd walk away from some frustrating code for a short time and the answer would suddenly come to me without thinking about it. In fact, as ridiculous as it sounds, I think I'm often a better coder when I'm away from the computer.

The shower; it's always in the shower. Now if I could just convince my wife that cleaning up Sharpie on the shower door is better than me dripping into my keyboard...

If *Weird Al* can code in the shower...

(If you've seen his White & Nerdy video, you'll know what I'm talking about. If not...go see it! :) )

I've had this many a times. I actually use it now I know it works like that :-)
When I have a hard problem that I haven't been able to make progress on for over an hour I just drop it and go do something completely different. Then, usually, after a while the solution pops in my head.
I think that when you're so focussed on solving a particular problem, you've essentially chased your mind in a corner and it's fixated on solving the problem while looking at it from a certain angle. Then when you stop thinking about the problem, your mind gets out of the corner and can wander around free. Then it looks at the problem from a totally different angle and you're able to see a solution.

Ha ha! I get interrupted sleep several times a year due to debugging like that :) But I'm glad to have the bugs wiped out!

Once, I solved almost all of the world's problems while out drinking.

Amen to that! Once I spent 2hrs struggling while some C code wasn't compiling.... I went for lunch, came back, sat down...and the problem was right there: missing semicolon. :)

I had a project once, and my solution wasn't workign right. Then I dreamt about a way to do it. I went to work, and was like I doubt it'll work but what do I got to lose... it worked!!

I believe this has to do with the physical process of learning. It is just the brain starting to connect those neurons. I have had this with everything related to learning. Learning is problem solving and programming is learning how to solve problems. But I especially had this when learning new maths or a new vocabulary (latin for example). It is just that in the moment of learning I cannot "get it". Then, after a while, sometimes days later when not even actively thinking about it anymore, it suddenly "plops" into mind. And then you always ask yourself how you couldn't have thought about this earlier. Well, you couldn't have because the physical pathways and connections in your brain just "weren't there" yet.

Heh, so familiar, that I actually refuse to spend too much time on either problem. If anything is giving me problems for more than half an hour, I give up and continue tomorrow. It's usually resolved in 5mins.

p.s. Sorry for this abuse of the comment, but...There is a problem in FD with password-protected feeds. I have only one, DaringFireball.com members feed. Click on "update all" icon always asks me for user/pass, even though it is written in URL. Update on the feed itself does not asks for user/pass. I'm using

I'm another guy who seems to always have inspiration strike in the shower. That first fifteen minutes of being awake really should be billable time...

The shower is a good way to solve a problem, as is spending a few minutes in another part of the bathroom...

Possibly the best is getting a haircut and having a scalp massage as part of the rinsing step.

Above all, though, I think the key is not being near a computer. If you're at your desk and you start to get an idea about how to fix something, it's almost impossible to not start banging away at your keyboard. in the shower, etc, there's no keyboard and so you think things through a little better.

Basically - computers are bad for developing code...

I can't even count how many times I've woke up at 3am with the solution to a programming problem. It happens to me all the time. It's pretty amazing how the brain works--although all that racing of my mind does make it hard to fall asleep at times...

i find cigarette breaks the best source of inspiration when i'm stuck on something. it's amazing how much simpler things are when away from the screen.

i reckon, due to their frequent breaks, smokers make the best coders!

that's one reason I keep a pad of paper with me in the car... (yes, I pull over to write)... solutions to problems I've been wrestling with during the day come to me when I'm not staring at them anymore... just need to give you brain time to process in a less-focused way sometimes.

The comments to this entry are closed.