Tales of a Developer: I Code in my Sleep
You know what I am talking about. It happens to us all at some point.
Oh no it doesn’t, you’re just being silly/bragging/etc.
No. It will happen if it hasn’t already so just shut up and listen.
The Night Before
You’re working on a project, it’s late at night, you can barely function, so you close the lid on your Macbook and go to sleep. A meer fifteen minutes later and you’re coding again. How is this possible? You’re not at your computer anymore. You’re off in la la land and yet the project you’re working on continues to consume your subconscious.
Suddenly, at 3am, you spring out of bed, open up Textmate, and write in some code, relaunch your application and sometimes it works perfectly, other times the foos and bars don’t line up properly so you start trying to fix it. Next thing you know it’s 5am and you need to wake up for work in an hour. Then you get back into bed, angry at yourself for ruining your sleep, and get out of bed an hour later, shower, head into work a complete zombie.
Back in the Office
Good night last night Patrick? You look like you got trashed last night. No hair gel? Wearing your glasses?
Yeah no I was just working on a problem. Didn’t get much sleep.
Yeah ok buddy. Catch you later.
And then you space out at your desk like Peter Gibbons and nothing actually gets done until you’ve had 5-6 cups of coffee and it’s the afternoon already. Chances are your accomplishments the night before are thrust into the shadows by the total lack of productivity when you’re back in the office the next day.
After the 5:00 Whistle
You arrive home, take a nap, wake up, have dinner, and sit down and start coding. Vicious cycle isn’t it? Pretty soon you just become completely consumed in what you’re doing and it ruins you. You become a mad scientist, only, you’re mad at yourself and you’re spinning your wheels going no where. Time to take a step back and look at the bigger picture. What the hell are you doing to yourself Patrick? You begin to think an addiction to blow would be healthier than this.
The Big Picture
I don’t claim to know everything, but I do claim to know what happens to me. I can do this because I’m an expert in most things pertaining to myself. I’m still quite sure that the things that happen to me also happen to others. What I’m getting at is a lot of people work their brain trying to figure things out and get work done, effectively exercising their brain. When they try to go to sleep their brain is just chugging away while the rest of your body sits there completely suspended. Even if you aren’t coding in your sleep, or solving problems that you were thinking about the entire time you were awake, you are still not resting completely. Between China trying to steal your name, the projects you have at work and in your personal life, getting more followers on twitter, and maintaining all of your real world relationships, it’s a wonder your brain can relax and let you sleep. If you think about it (not too hard), you quickly realize that sleep starts before you get into your bed.
Sleeping before Sleep
And I’m not talking about napping. I’m talking about getting your mind off of the thing that’s consuming you. Perhaps it’s time for a new hobby. Have too many hobbies? Maybe you should exercise. The wonderful thing about exercising is that it helps you feel better mentally and physically. I started running again and I’m following the Couch to 5k using Robert Ullrey’s Podcasts. In addition to that, I do my best to make sure that the thing I do before going to bed is not the same thing I’ve been doing all day. I’ll read the news, some blogs, and maybe go through some email. Nothing that gives me brain strain. We sit inside all day under flourescent lights, working on computers. Doing something the complete opposite on the geek scale rounds you out, makes sure you’re completely tired, and helps you to get a good night’s rest. This in turn makes you more productive the following day.
It’s not about the hours you spend working on a project, it’s about whether or not you make progress on the project. When you step up your game, change things up, and round yourself out you can find that you get more work done in much less time. This in turn allows you to improve your overall quality of life and do other things that you normally would not have time to do.
But Patrick, I have such great breakthroughs in my sleep sometimes.
That’s great. I have several break throughs in a given day and I don’t look like a party animal alcoholic the next day in the office. I used to think that having my subconscious do work for my in my sleep was something to brag about, but it’s not. If you stop it from happening in a positive way then you to will find you’ve just upgraded your life.
Tags: development, exercise, lifehack, self-improvement, sleep