Slashdot Mirror


How Do You Maintain Your Work Focus?

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?"

19 of 153 comments (clear)

  1. Motivation by Rydia · · Score: 3, Funny

    Constantly remind myself of my company's small army of trained ninja.

    1. Re:Motivation by blugu64 · · Score: 5, Funny

      I just ask my self with every action, is what I'm doing good for the company

      --
      "Personal ownership is a hallmark of conservative capitalism. And I don't believe I am entitled to anything that I did n
  2. Two Options by acvh · · Score: 4, Insightful

    One - Provigil.

    Two - Trust your feelings, Luke. If you're already "making more" than you need, and you can't get motivated to make more, then don't. Go out and have some fun.

  3. Priorities? by sharkey · · Score: 5, Insightful

    If you are making more than you need, and more than you are used to in a "shorter than normal" work week, perhaps you should go to the pool or something. It sounds like you are working to get money so you can HAVE money, not so that you can attain any other goal in life but to get more money.

    Perhaps your motivation problem is that you seem to have no goals outside of the numbers on your bank accounts.

    --

    --
    "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
  4. Add a bit of Diversity by SubliminalVortex · · Score: 5, Insightful
    I'm almost convinced that programmers are afflicted with 'ADD' as a side effect. It's very easy to get bored with a programming task (especially one that is boilerplate) so we go off on a tangent trying to automate the process of writing boilerplate code.

    I find that when spending too much time looking at the same code, it starts becoming 'vague' and I feel as if I'm in a fugue. It's akin to the same thing as writing a story or some e-mail and thinking that you've misspelled the words 'it' or 'and'. It may very well be correct, but it looks foreign and you try to fix something that isn't broken. At that point, it's time for a mental break.

    I actually tend to take at least three breaks a day for about five to ten minutes each. The first two, I read Slashdot; usually around 10:00am and the other right before lunchtime. I don't eat out often, but I do pick up lunch and then around 4:00pm, I check out the latest 'IT' curiosity posted on The Daily WTF http://www.thedailywtf.com/. I also check Slashdot again right before I leave so I don't miss some of the few gems posted here.

    A lot of IT shops have their eye on Web browsing, but they usually won't pay mind to it unless you're not producing or you have a tendency to frequent sites that raise an eyebrow or two (hint: pr0n sites tend to fall in that category). I do like to visit sites geared towards developers, such as GotDotNet http://www.gotdotnet.com/, CodeProject http://www.codeproject.com/, CodeGuru http://www.codeguru.com/ and the latest "up and coming" Krugle http://www.krugle.com/ code search engine. Sometimes visiting those sites will give a tidbit or two that is useful; you may run across some code or solution to a problem that interests you. Also, you may end up learning something that you'll run into in the future. (Coders tend to re-invent the wheel if they don't have the code handy; however, if the code is there, they tend to add spinning rims to it.)

    Adding a bit of diversity to the routine helps keep you on the edge and refreshed to approach a problem in a new light.

  5. Follow these steps by Anonymous Coward · · Score: 5, Funny

    Step 1. Stop reading Slashdot

    Step 2. I still haven't gotten past step 1, but when I do, I'll let you know.

  6. Long lunches by Bender0x7D1 · · Score: 4, Interesting

    Where I used to work it was pretty normal for people to come in early (about 7:00AM), take an extra long lunch (1.5 - 2 hours) and then work until 5:00PM. They put in their 8 or 9 hours, but have a nice refreshing break in the middle so they can handle the afternoon. Also, people would go to the gym at lunch time to refresh their minds for the afternoon.

    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?

    --
    Reading code is like reading the dictionary - you have to read half of it before you can go back and understand it.
  7. Thought exercise by mortonda · · Score: 3, Funny

    I keep my attention on task by .... um.... what was the question again?

    Seriously, I have the same problem, as a contractor... Some days I'm lucky to get 1 hour billed. OTOH, I have a 14 month old boy that keeps distracting me. :)

  8. Easy answer... by Anonymous Coward · · Score: 5, Funny

    127.0.0.1 www.slashdot.org

  9. I think by countach · · Score: 4, Interesting

    The best thing you can do is have a siesta. Sleep for half an hour and come back to work.

    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.

  10. Temperature Control by tansey · · Score: 4, Interesting

    You'd be amazed how much better you work at 65 degrees than say 72. The building my employer recently moved into is new, and was designed for normal 9-5 business days, so after 5:30, the AC cuts off and by 7 the temperature is around 75 degrees. Since I'm much more of a night person, I come in around 1pm every day and stay til around midnight--or at least I did until we moved into the building.

    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.

    1. Re:Temperature Control by gozar · · Score: 3, Informative
      You'd be amazed how much better you work at 65 degrees than say 72. The building my employer recently moved into is new, and was designed for normal 9-5 business days, so after 5:30, the AC cuts off and by 7 the temperature is around 75 degrees.

      I think the fine folks at Cornell would disagree with you.

      --
      What, me worry?
  11. I don't by JanneM · · Score: 5, Interesting

    I don't maintain focus for more than an hour at a time. In fact, I can't. And being involved in cognitive science research, I can state that for sustained work, neither can anybody else. Yes, once in a while, if your current problem is intensely interesting, you can zone out and work on it for many hours straight. But most work - however interesting it is - isn't able to grab your focus in that manner. To see it from another perspective, a movie is designed to grab your attention, is created by people devoting their lives to grab your attention as effectively as possible and has about every technical means short of drugs available to grab and hold your attention. And yet, few movies are longer than two hours, because people will not be able to hold their focus for much longer than that.

    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.

    --
    Trust the Computer. The Computer is your friend.
    1. Re:I don't by Josuah · · Score: 3, Interesting

      Instead, accept that you can't single-mindedly focus on any one thing for more than about 45 minutes to an hour....

      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).

  12. A little stress is a good thing by JavaRob · · Score: 3, Insightful

    I work independantly as well. It can be tough to work up the motivation to get going on things, and I occasionally have the experience of realising at 10pm that I've spent about an hour of billable time that day -- the rest was running errands, procrastinating, websurfing, reading news, socializing, etc.. Sometimes I'll then work another 7 hours, which sometimes works okay (sometimes my brain really starts clicking only late at night)... but of course makes it that much harder to get started the next morning.

    Of course, the answer is self-discipline, time management, etc., but there are a lot of factors that affect how successful I am at that. Here's what I'm watching properly during the times that things are really working well:

    * Personal physical factors: I avoid caffeine, because it keeps me "awake" but destroys my focus. If I'm really focused, I simply won't get sleepy anyway. I avoid all alcohol during the week, and avoid sugary things at night, because those both affect my sleep patterns and sharpness in the morning. Proper sleep also makes a huge difference to focus... if I only slept 3-4 hours, even if I'm wide awake things just don't seem to get done.

    * Project factors: an interesting project that uses my knowledge/skills but also brings in some new things is much easier to work on. Boring projects (just solving the same old problems again in a slightly different way), overly tedious/frustrating projects (like cleaning up someone else's mess or working with really buggy APIs), or overly daunting projects (working with a new language, in a domain only vaguely understood)... that's when I end up bouncing off the work into random other activities like a stone skipping off water.

    * Work organization: I try to stop periodically to make priorities lists and to-do lists, and to break down tasks into smaller and smaller sections. It's important for scheduling purposes already, but the mental benefits are also huge. You can hit lots of little goals to keep you going, like "just get this query finished, send that email, then I can break for lunch".

    * Breaks: get up and walk around when you're stuck. Don't just sit in your chair (or take a break by going off to check /.) -- walk around and maybe get some fresh air. Let your mind play with the problem and come up with some new solutions to test out before you go sit down again.

    Now I just need to follow my own rules *all* the time....

  13. Music by WasterDave · · Score: 4, Interesting

    Get a favourite album, one you know well. Put it on repeat, drop into the zone and code for an hour or so. Do this for ... dunno, maybe twenty or thirty repetitions and you'll quickly find that putting the music on drops you into the zone whether you want to or not. As an added bonus you'll find memories associated with the music so getting back into the work is faster.

    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

    --
    I write a blog now, you should be afraid.
  14. Here's what works for me by hobuddy · · Score: 4, Insightful

    My work environment is very flexible, so I'm pretty much free to structure my time, as long as I get the work done. But let's face it: a larger slice of programming than we'd like is friggin' boring drudge work. Here's the most effective strategy I've found for concentrating on work:

    - Get enough sleep, and get up early (heresy for a geek, I know).

    - Have some breakfast and then *dive right into work while you're still fresh*. Don't squander these precious hours on Slashdot and Reddit! Do 3-4 hours of work until your morning high is gone.

    - Then stop and do some very intensive physical exercise for 45-75 minutes. By "very intensive", I'm talking about the frothin-at-the-mouth, panting, totally-drenched-in-sweat kind of stuff. My chosen exercise is to split firewood with a maul, at the fastest pace my body can handle.

    - After going all out on the exercise, take a shower.

    - Eat lunch and enjoy a bit of leisure (read Slashdot or whatever). At this point, the post-morning-high crash is long gone, but it should have been replaced by a feeling of relaxation (because of exercise -> shower -> lunch), but still with adequate energy because the exercise revved your body up. I find that if I don't do the (very intensive) exercise, I tend to be very sleepy from the time the morning high wears off until the end of the work day.

    - Do another 3-4 hours of work. You'll probably find it easier to concentrate on boring work during this period of the day, since you'll be mellowed by the exercise -> shower -> meal.

    - If 6-8 hours is enough, you're now done for the day. However, I sometimes find the very most boring work most tolerable between 8 p.m. and 10 p.m., when my body is winding down toward sleep. Just don't do anything so absorbing or intellectually taxing that it wakes you back up, or you'll be up really late.

    I know these suggestions are not realistic for most people, but for those who work from home, they're feasible. That mid-day exercise provides a huge boost to my ability to concentrate.

    --
    Erlang.org: wow
  15. Are you sure you're making more than you need? by Pyromage · · Score: 4, Insightful

    If it weren't for all the other people here saying 'enjoy the time off' I wouldn't say this, but: *no*, you're *not* making more than you need!

    Ok, maybe you are. But I doubt it. First, a contracting career is not secure. That's why they pay you a premium: because you constantly take the risk of being fired without another gig lined up.

    Secondly, how much are you saving? Emergency funds? Retirement nest egg? Do you have health insurance, 401/k, etc? Contractors usually don't.

    Just because you're more than covering all your bills now doesn't mean you're making enough. If you don't have enough cash or readily liquidatable assets to cover 6 months expenses, I wouldn't be 'not worried', I'd be absolutely panicking.

    My serious advice: see a financial planner, figure out how much you should be saving. Get a second contracting job to fill the other 20 hours of a full work week. You should be able to more easily focus when you have totally different projects.

    And as far as motivation goes, shipping quality products to customers who appreciate it is more than enough motivation. I love seeing a hearing a customer tell me he's happy with the product, even though it cost him around $300k.

  16. Several suggestions... by wanax · · Score: 3, Interesting

    1) Work in a cool & dry environment. If it's too humid or warm, you'll get lethargic and have trouble getting motivated.

    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 ;p). I find that if immediately after I wake up, I sit down in front of the computer and work until I'm bored it really makes me get a lot more work done. On the other hand, if I sit down in front of the computer and start checking news sites, etc. then it often takes me a lot longer to initiate doing the real work.. which is the major struggle in the first place.

    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.