I have an interesting trick where I have a piece of myself watching the rest of myself doing whatever it's doing. It helps me understand my inner workings quite a bit, because I can review how I was feeling and thinking after all the main activity is over and done with.
Reviewing the last week and a bit, I noticed that I've had periods of uptime then downtime. This is normal for someone working at a computer, because at the very least you need to take a 2 minute break every 20 minutes, to catch up on your blinking and to stare at objects in the distance so you don't ruin your focus. If you're not doing this, you're doing damage. If you're an employer, you need to force your employees to do this, even if you have to put a timer on their computer.
But aside from the eye-strain (and tendinitis, carpal tunnel syndrome or other repetitive strain injury) breaks, I've had periods of mental "downtime". But it's not like walking away from the computer when getting burnt out. I take breaks under two conditions.
- A major success.
An interesting problem.
The break after a major success is just to acknowledge the success and to have some time to wipe away the brain clutter. Aside from the morale benefits, acknowledgement like this also allows me to tune back into the world to know what time it is, take bathroom breaks and perform backups of what I was working on.
The second kind of break is a curious one. I found myself pausing when I find myself spinning my wheels going nowhere, getting frustrated or when I'm generally out of ideas. I pace around, or I lay down but don't sleep. When doing so, I find that I'm mulling over ideas constantly. I even start some meta-programming in my head.
I've really encouraged the mental meta-programming to see how it worked and if it helped. I've rewritten intimidating chunks of code before and after taking the time to think things through, and I've noticed that my skill is vastly improved after walking away from my computer to think for a while.
I've read everything I could get my hands on that's been written on this subject, and I've even taken the time to chat with a number of people who I could easily call a hacker. They often have a habit of taking on a job and not doing it until very late in the game. I've even heard stories of some people doing at most some basic structuring early on, and then lying on the phone when asked for updates while just hanging out with friends and then right before the deadline they spend a couple of late nights hacking away until it's done.
- My hacker plays video games on company time.
- But it's been two weeks since I saw anything!
- Isn't this damaging to productivity?
- My hacker is constantly doing things unrelated to her job responsibilities.
My hacker is writing a book, reading USENET news, playing video games, talking with friends on the phone, and building sculptures out of paper clips. On company time!
So it's this sort of "unproductivity" which I've been embracing, and I've noticed that it's given a startlingly big advantage to my programming when I get back to my desk.
I'm not entirely sure how it works and I suspect that it has a lot to do with my brain's physical wiring/chemistry. I know that previously I could nap after learning something new or having an interesting idea and then I could come back after the nap and the skill would be more present. But now this waking variation of it helps with juggling complex programming problems.
I'm coming to the point where good programming theory is having a big impact on the quality of my work. Previously, I just didn't get most of the theory and it would only get in the way. That's like a guitarist who can play well by rote but who can't read sheet/tabbed music. I never could "play well" for programming, and now that I'm improving I'm finding that learning to read the sheet music will help a lot.
So I highly recommend regular breaks, even if you feel unproductive. You'll be surprised what you'll be able to accomplish once you get back to work!
My next goal would be to figure out how to juggle blog posting like this while programming.. one mindset seems to overwrite/displace the other.