How Do You Maintain Your Work Focus? 153
chowsapal asks: "I've recently switched from another line of work into computer programming, where I work as a contractor. I'm making more money than I need, and more than I'm used to even working 20 or 25 hours a week. I'd like to work more, and rake in even more money, but sometimes it's hard to stay focused for more than 5 or 6 hours at a time. What do other programmers do to motivate themselves? Do you work a specific set of hours? In a specific location? Are there types of breaks that you find really increase productivity? Does diet and/or coffee consumption make or break the deal? Do you end up working late at night for the quiet? I realize that on some level you just need to suck it up and put in the time, or stop worrying about it and enjoy your time off. However, the question stands: How do you work best outside an office environment?"
Long lunches (Score:5, Interesting)
Another tactic was for people to come in late, about 10:00AM, go to lunch at 12:00PM for an hour, work the afternoon, go home for an hour or two to eat supper, and work a few more hours from home. Some would also come back to the office for a few hours in the evening - but they generally lived pretty close-by. After work, they could go out, stay out late, but be able to sleep in the next morning.
I think the important part is determining how long you can go without a serious break, and then figuring out how to work that break into your schedule. It may mean starting earlier, or working later, but you still get your time off. Why go to the gym in the morning, when you can go at lunch time and refresh yourself for the afternoon?
I think (Score:5, Interesting)
But most of the time it's best not to work at all. I can get a ton of work done in a few hours in the morning, and the afternoons are often a write-off. I might as well have gone home. If mornings are you best, schedule meetings in the late afternoon as much as possible so that you don't waste your most productive times. Make the most of your most productive hours and do admin the other hours.
Generally, I don't believe in the idea you can "push yourself" into creating more software by staying more hours. All you'll do is make yourself even more tired and not produce any more output.
Temperature Control (Score:5, Interesting)
The few of us who stay past 7 have all come to the conclusion that heat will make your brain slow down a LOT. It's gotten to the point where I just started going home at 8 or so because I would accomplish absolutely nothing by being there.
So my advice is to make sure you keep your work environment at a slightly-less than relaxing temperature, just to make sure you stay on your toes.
I don't (Score:5, Interesting)
If you try to force yourself by having only your work available and forcing yourself to sit on front of it, all that will happen is that after an hour or two your thoughts will start to drift, you'll get stuck in a rut reiterating old thought processes, and you may even nod off for short periods due to the imposed lack of stimulus variation. In short, "maintaining focus" is a good way to sink your productivity.
Instead, accept that you can't single-mindedly focus on any one thing for more than about 45 minutes to an hour (there's a good reason class time seems to have converged to about 45 minutes the world over). Do one of these things in combination:
* Get up, stretch and move about a bit. Go look out the window, find someone else on a break and shoot the breeze for a few minutes. Leaf through the morning paper, trade magazine, or that 2001 office supplies catalogue you never seem to get around to throw away. Go over to Accounting and ask about that missing trsvel reimbursement. In short, get yourself exposed to some new stimuli so you canh approach the next hour with a fresh mind.
* Have a secondary task you can switch to whenever you get bored with the main one. Maybe now is a good time to answer a few email, or write some documentation (there's always documentation to write). Really the same thing as above - get some new stimuli - but with more of a work focus.
* Set a goal for the day. And when it's done, quit. Sure there's more work to be done - but there's always more work to be done. You can stay 24/7 and there will still be more. Do what you set out to do, then go home. With a definite short-term goal, pacing yourself is easier, and it's much easier to focus on a comprehensible, digestible chunk of work.
Music (Score:5, Interesting)
Clearly you're going to need to change music from time to time but because of the memory associations I suggest you have an album per module, or per project, or whatever suits you. The memory associations also make maintenance easier.
But, danger! Do not listen to the work album and fsck about!
As a starter can I suggest "Snivilisation" by Orbital.
Cheers,
Dave
Ritalin! (Score:2, Interesting)
Why? (Score:3, Interesting)
I saw the coroner van in front of a $10 million house on Friday. See all the good that money did the dead guy.
As a contractor for 12 years I found that I get more down in my part-time hours than most people get done in their full time jobs. What's the lesson there? Double my rates.
On topic, you can stay focused by paying attention to your productive cycle. Do you work better in mornings? Evenings? Do you work better on a four or six day work week? My most productive times are 2-7PM and midnight to 5 am on a thirteen day work cycle (10 on, three off).
Also you should have a designated office space if you're working from home, something closed off from the rest of your home so you don't suddenly realize you need to do dishes or get the mail, etc.
If you don't have a lot of time specific events (calls, meetings, etc) throw away your alarm clock and find your natural sleep schedule. It will take around 6 weeks. Waking up and falling asleep naturally helps prevent fatigue and keeps you alert, and prevents burnout and mistakes.
Take time to eat proper meals, and don't eat sitting at your desk. Eating properly will help your concentration and leaving your desk will a) keep you from becoming a fat bastard, and b) induce more natural breaks from your work.
Of course some people just can't work in an unstructured environment. For them it's back to work.
Several suggestions... (Score:4, Interesting)
2) When you're sitting in front of the computer and the work is just not happening, and you've reloaded slashdot 5 times in the last 5 minutes etc, get up and take a break. Don't force yourself to sit there. Walk around the room, or better yet that's a good time to walk to the store and do errands.
3) On the similar vein to #2, get yourself on a normal exercise program. Not a beat-the-crap-outta-yourself one, but something like trying to bike for an hour a day. When you're not motivated to work, get on the bike and go work out. It'll both give your mind a chance to float (and often come up with an idea about what you're working on), but once you make this a habit, you'll be more invigorated when you're done.
4) Most people can work most efficiently on stuff like programming immediately after they wake up (whenever that is
5) In terms of diet, caffeine and stuff like that.. I personally find that I work best when I'm not drinking, not eating sugary things that'll cause my blood sugar to fluctuate, and not on caffeine unless I absolutely need to stay up because a deadline is looming (another advantage of that is the caffeine works a lot better).
But beyond that, I'd echo other people's comments that if you're not having a problem supporting your lifestyle workings 25hrs/week, then take advantage of that and do things you find fun, indulge your hobbies etc. Chances are you'll wind up being forced into 40+hr/week situations for periods in the future, so take advantage of your current situation.
Environmental differences (Score:3, Interesting)
For me, it really depends on the environment.
While at college, I'd usually get the most work done listening to a loop of some pumping Nine Inch Nails while in a public place - people are usually too intimidated to walk up to you when you are banging your head and the keyboard at the same time (that is how I did a semester of programming in 3 days - 12 hours each day).
For my current primary job (graphic artist and web developer for a newspaper), I'm lucky to not have to come in until 9. I'll usually come in, check my e-mail, plan out the order-of-business, and do misc things not directly related to graphic design or web development (my primary duties) - not wasting time, mind you (I have a few duties that are more organizational than "turn-crank, produce product"). I'll take my lunch at 11:30, come back at 12:30, and be ready to start cranking everything out.
For my own web design business I run, I usually take my laptop into a public setting (I prefer the local coffee shop). I welcome interruptions, just because most people know I don't necessarily want to stop for a long period of time. Every half hour or so I'll have a 5-15 minute conversation. Sometimes I'll just quit working after an hour and socialize, but other times I'll work for 2-3 hours total, with solid productivity.
It also helps, on occasion, to mix up whatever duties you have. I like to avoid doing the same thing for more than 2 hours straight.
Outside of an office environment (Score:3, Interesting)
I think this is the key that many other people who have posted are missing. Outside of an office environment, it's really tough to maintain that discipline. There are too many distractions at home. Many can do it, but the majority aren't wired that way. So don't think that, short of drugs, you can just change a couple of things and magically focus twice as much. Odds are, you can't.
My advice, having experienced the same thing, is this: find other contractors in your area who are in the same boat as you. Get together and get some office space and recreate the office environment. Generally what I've found is that what motivates people -- and I certainly fall into this category -- to work is being in an environment where everyone else is working too. Then when you stop working, you start feeling like the odd man out and want to work again. So if you can get a reasonable sense of the office environment, you can motivate yourself that way. And, if getting actual office space isn't feasible (and there are tons of reasons why it may not be a good good risk for you) then consider looking up various packaged/executive office spaces where you can rent a small office. If you're in a larger city, you're bound to find companies offering this service... generally anywhere from about $400 to $1000/month depending on size of office, what services are included, the going rental rates, etc. You often also get the benefit that they'll answer your phone professionally for you, which might be a plus for you too. If you're in a smaller city with a low cost of living, you might find something even cheaper. But the extra cost will more than make up for the increase in productivity.
Or, partner up with a company that you've dealt with before. Many have more office space than they need and might be amicable to letting you take up an unused office or desk in exchange for some consulting work.
Re:I don't (Score:4, Interesting)
Or perhaps it takes a certain mindset. I have no trouble doing this when it comes to coding. But then I also have no trouble doing other things for hours on a time, including movies (all three LoTR:EE in a row), TV shows (10 episodes of 24 in one sitting), video games (earlier Zelda games in one sitting), books (read for hours straight). Earlier today I think I spent about 2-3 hours working on my postfix settings and I didn't even realize it'd been that long. There was one summer I coded for 16 hours, slept for 10 hours, and repeated that schedule for maybe two weeks.
I'm not trying to toot my own horn. I just think making that generalization based on what you've learned in CogSci might be an incorrect generalization to make. Sure, all of those things interest me, but I've found myself doing that even when I don't particularly like what I'm doing. I have a compulsion to finish things, which one of my coworkers finds idiotic. He'd just stop watching a bad movie whereas it wouldn't even cross my mind to stop watching (and only watching, not doing other things at the same time).
Re:Temperature Control (Score:3, Interesting)
Yeah, some individuals' metabolisms run at different rates, and it also depends on what sort of work you're doing (if you're furiously chopping wood, you can be overly warm at 10 below zero, even in just a T-shirt).
But for average folks, keeping the workplace a little warmer makes sense, since if you're chilled, the body responds by limiting the blood supply to the extremities, and eventually to the brain as well. Remember that one of the risks of hypothermia is disorientation or loss of cognitive function, and if you're sitting in a 65F office all day, you *can* become mildly hypothermic.
Re:Music (Score:3, Interesting)
I have a playlist called "naptime", which is all my faves from one particular group, always played in the same order. I start WinAmp with the volume just high enough to be able to make out the words, flop down on the couch, and by the 3rd song I'm asleep from sheer habit. And somewhere during the last couple songs, I wake up.
The object of a nap is to get some rest without going into deep sleep (since once that happens, the whole ~2.5 hour sleep cycle has to run its course, or you'll be groggy until it would have). The music triggers the nap, prevents it from delving into a too-deep sleep cycle, and provides the wakeup trigger as well.
Re:Here's what works for me (Score:1, Interesting)
You know, this helps quite a few things. Not only does it increase work performance, but other tasks like effectively studying or losing weight (or gaining weight if you're a lifter) have been linked to getting the proper amount of sleep.
Eat a fairly high protein breakfast and find a way to work a teaspoon of cinnamon onto your toast. This helps with blood sugar issues.
And yes, if anybody wants to google cinnamon was inadvertantly found to have a positive effect on lowering blood sugar.
This works, and another way is that if you work in an environment with a gym you can get to at lunch, learn how to deadlift, squat, do pullups, and military press. They're all very practical strength exercises, and after you learn proper technique they've been shown to have a tonic effect. Shoot for warming up and then doing three sets of 3-5 reps of each, heavy weight. Don't do all exercises every day though, say Mon-Weds for squats and military press, Tues-Thurs for deadlifts and pullups. Friday: go walk.
If you can't do that, go for a brisk half hour walk.
Or risk being unpopular with the coworkers.
Indeed!