Comments

Why coders should work 5 hours a day!

I have a strong opinion:

Programmers should work 5 hours a day.

Without knowing you or the kind of projects you’re working on, I can guarantee that 80% of what you deliver in a given day comes from the first 5 hours of your day. In fact, most likely within the first 3 – 4 hours, before your lunch break.

If I had a software development company and I was to employ you, I’d pay you the same salary as someone working 8 hours a day, but you’d work only 5 hours a day. I’d let you go home and enjoy whatever you like!

Unfortunately, despite living in the modern era, our workplace is still following a traditional system: the typical 9 to 5 working hours. While this may work for many industries, I don’t find it optimum programmers.

You’re at risk for RSI

There was a time I used to code for 12 hours a day, sometimes including weekends! Guess what happened? I started to feel pain in my wrists. Many know this as Carpal Tunnel Syndrome, which falls under Repetitive Strain Injuries (RSI) umbrella term.

My pain started in my wrists, and then travelled to my palms and forearms. At some point, I was in so much pain that some days I could only code for 1 or 2 hours and then I had to leave work. I used to be a contractor, so leaving work meant I was not getting paid! You can imagine how stressful this was, which made my pain even worse. Plus, coding has been one of my passions and thinking that I could not code like before was very depressing.

A lot of programmers develop this kind of pain at some point in their life. Some (like me) manage to recover (not 100% though), but for others, this remains a challenge for the rest of their life.

Many others develop pain in their forearms, neck, shoulders or lower back. All this can be due to stress, bad posture and working long hours without having regular breaks.

A simple solution

So, now you know that as a coder, you’re at risk for pain in your wrists, forearms, neck, shoulders and lower back. And you also know that most (if not all) companies out there still follow the traditional 9 to 5 system. So, what can you do to keep a healthy body?

Code for 45 minutes and then have a 5 – 10 minute break

Not only will this prevent you from developing all sorts of pains due to excessive use of keyboard, but it’ll also help you increase your productivity significantly.

Now, this formula sounds pretty simple but there are exceptionally few programmers who actually practice it. I personally think perhaps 1 out of 100 programmers take regular breaks when coding, maybe even fewer! But why?

I’m going to list a few “excuses” that most programmers give for not taking regular breaks. Read and see if you can relate to them.

Excuse 1: My employer thinks I’m wasting time

If your employer has problem with you taking a 10-minute break every 45 minutes, you need to look for a different job. I’m dead serious! Do you care about yourself and your body? If you’re reading this post up to this point, you certainly do.

You either need to educate your employer or leave them. Taking regular breaks not only helps you maintain a healthy body, but it also increases your productivity significantly. All this means, as an employee, you’ll perform better for that employer. You’ll write better code in less time. So, your employer should in fact encourage you to take frequent breaks.

Send this blog post to your manager and peer programmers and try to establish this culture in your company so everybody get up and have a 5 – 10 minute together. Make it fun. You can start work at 9am and have a break at 9:45am. Everybody gets up, do a few stretches or go for a short work.

Remember, break means detox from technology. If you’re still sitting at your desk but browsing Facebook on your PC or mobile, you’re not on a break. Get up and go for a short walk around the block. You’ll feel 10 times better when you get back.

Excuse 2: I’ll lose focus if I have a break

You won’t! It’s all in your head. When you leave your desk and go for a short walk or something else, your subconscious mind is still working on the problem even if you’re not actively thinking about it. When you get back to your desk, you’ll be fresh and ready to do another 45 minutes of ninja coding.

Also, just before leaving your desk, you can write down the stuff you want to remember. That helps too.

Excuse 3: I forget to have a break!

I can totally relate to you on this. It’s quite easy to lose track of time when you’re coding. The simplest solution is to set a timer on your phone.

You should discipline yourself, so as soon as you hear the alarm, you get up and leave your desk. Do NOT say to yourself: “No, I’m going to finish this in a minute and then I’ll go”. That one minute becomes five minutes and then eventually becomes hours.

So, one more time: discipline yourself so the moment you hear the alarm, you get up and leave your desk.

 

Share your thoughts

What are your excuses for not taking regular breaks? Share them in the comments section and I’ll see if I can help you with them.

Did you enjoy this post? Please share it with your colleagues and friends.

 

Tags:

42 responses to “Why coders should work 5 hours a day!”

  1. Salim says:

    Great Topic….. Thanks

  2. Myat Lay says:

    Really true!
    That’s a good idea

  3. Robin says:

    Thanks for posting this, Mosh. You nailed it.

  4. Garnet says:

    Hi Mosh,
    That’s true! And what’s more company should provide height adjustable working table! Can do stand-up while coding

  5. Tiger says:

    Defo again and find myself getting away from the desk for a break every hour or so.

    But for me I’m more productive closer to the end of the day then the start.. Go figure.

  6. Jack Clark says:

    “I’d pay you the same salary as someone working 8 hours a day, but you’d work only 5 hours a day.”

    Please start a company. I would relocate to Australia for this!

  7. tahir says:

    Hi , Mosh
    I completely agree with you i do practice it during my work however many employers do not understand this philosophy and they will mind it .

    • admin says:

      Send them the link to my post, and ask them to read it 3 times! The reality is out of those 8 hours a day, employees waste a lot of time anyway. Lots of mocking around, email checking, Facebook, texting on the phone, chit chat, useless meetings that just waste everyone’s energy! The real productive hours are no more than 5 hours. I stand by my opinion!

  8. Kyrylo Seliukov says:

    HI, I have a question

    In my team people often says that their work consist not only in coding, but of “thinking(planning) how to code”. So they think and the do coding. What do you think about this? Does this 5 our consist of thinking about some feature and then do coding, or you don’t split this things?

    • admin says:

      I see them all part of the 5-hour day job. Anything you do to build software is part of that. In my view, those 5 hours are pure software development, no mocking around, no wasting time in the kitchen chit chatting, no Facebook, LinkedIn, etc.

  9. William Steinberg says:

    Check out typematrix.com. This is for a $120 keyboard that is much easier on the wrists. And if you then add in Dvorak layout, even easier. The QWERTY keyboard was designed to be inefficient, and to slow down the typist, so that the keypresses wouldn’t jam. That is no longer a problem with a modern computer keyboard.

  10. Wasim says:

    I totally agree and working for 5 hours a day sounds great. However, you know normally we get projects with a lot of features and limited time to deliver everything.

    My question is,

    If you (as a contractor) get a project with tight deadlines, how do you suggest to deliver the project in time?

  11. Sander Schat says:

    if you start a company, i wanna work there. Just learned Angular2 very well ;))

    working on different angular2 projects right now, with a company who understand ‘less working hours’ is just as good.
    Hope to get a ‘standing’ desk as well, with a ‘bike-desk’ so i can sit, AND do some slow biking at the same time. Great for the mind too!!

  12. Nshouo says:

    I couldn’t agree more! I personally use the pomodoro technique, have been for about a year now. I find that many breaks throughout the day definitely help with the mental aspect of coding all day. However, I hadn’t really thought about the physical component. As far as being most productive during the first 5 hours of the day I think this is spot on too. I work as a contractor for the government, and outside of meetings I’m lucky if I get 5 hours of actual work done :).

  13. rtom says:

    HI Mosh, thanks for the article,

    My excuses for not taking regular breaks is, customers come to our company without an appointment

    Best regards

  14. Monte says:

    Hi Mosh. I have a question, as well. What if I’m working on a “side” project? How does the five hours factor into that?

    Say I get home from work, and I want to work on a side project. How does that factor in?

  15. Expanding on Excuse 2: IM and to a lesser extent email are the major distractions that completely disrupt workflow and thought. The ability to turn it off or ignore is critical for a developer.

    As you also mentioned, your subconscious mind is always working out solutions, for everything in life. Often it’s best to go for a walk or do something completely off task when roadblocked into problem. Your mind is not an unfathomable CPU. It needs “rest time”. Those millions of neural connections need time to sort out and categorize the data as well as maybe already has a solution and find it…

  16. Andrew says:

    Funny, as I’m lousy the first 3-4 hours of my workingday, I do the most in the last 4-5 hours after the break.. But then again, I’m not a morning person… And letting someone work 5 hours a day instead of 8 just results in less work being done, it’s not like someone will actually do just as much work.
    I think what you suggest will work perfectly for you, but you must not forget, nobody is the same (physically as mentally), so what works for you doesn’t mean it works for someone else..
    And people will check their favorite sites or mock around, even if it’s only 5 hours a day, so if an 8 hour workday is about 5 hours of actual working, a 5 hour workday would result in 3.5 hours (or something like that) of actual working.. nobody comes in, sits behind his/her desk starts working immediately takes their 5 minute breaks and at the end of 5 hours stops and go home.. that’s really a fantasy, and would even be an unhealthy working environment..

    • Vazric says:

      I hear what you are saying and in USA we have lots of lazy people , although in professional field I believe not only professional skills are important, the mindset personality and mental state is very much important.
      and if we move to 5-6 hours working day we will need to upgrade the way the whole system functions.
      and I cant totally agree with you since Sweden has 6hrs working day, Austria 7-8 and no more than that is allowed. Germany you HAVE TO take 6 week vacation..
      if these people and countries could figure out and do good why don’t we? I tell you why because of our mindset and the way we think we know everything, and not accepting that we don’t know what we don’t know about. so we can let and bring new things to table at least we can experience and learn from it.

  17. Lars Persson says:

    Not really related (but kind of):

    I have found that as a teacher in a high school the other teachers (some) and the principal doesn’t understand the problems of being a teacher in programming.

    There are a lot of work trying to think out excercises, testing them and so on.

    In the classroom you are trying to find out what the student did wrong. That could be a million things.

    As a programmer the boss often want things to be fixed fast. They doesn’t understand the process of programming.

  18. Ali says:

    I think is a very good idea to tell us we the young ones what’s going on in the industry.thanks to mosh

  19. Alexandre Laframboise says:

    A week ago, I knew next to nothing about programming. I bought your C# basics course just recently (my first programming language). Since then, I can make basic programs on the fly.

    What would probably have taken me a month or two to learn in college only took me a week following your courses, and I just want you to know that I enjoy your in-depth explanations on the functions of C# with your theories, as it makes it easier for me to understand the mechanics behind it.

    And now, knowing about the existence of potential wrist pains with your tips on how to cope with them (if it ever occurs) makes me glad to have followed you, since I feel like a lot of teachers would likely ignore the details about it.

    • admin says:

      Thanks so much my friend! Glad to hear I’ve been able to help you become a programmer! All the best and remember: never stop learning!

  20. Tim Long says:

    I do agree that professionals are paid to get the job done, not to be in the office for an allocated number of hours. However, I wouldn’t prescribe a fixed time. Personally I find that my productivity comes in fits and starts. Some days I will get a huge amount done in no time at all, then other days it will seem like I’ve done nothing all day. So when the code flows, I have to flow with it.

    If you work in an Agile team, then you have sprints with a planned amount of work in them and you have likely measured your velocity. I think an employer should let a developer work whatever hours they like, provided they have a reasonable velocity and the user stories are getting marked as ‘Done’.

    You also have to consider the psychological effect on other workers, to some extent. When other workers see the developers swanning off after lunch, they might resent that a bit. So there is some merit in just being on-site even if you’re not actually being productive. It’s unfortunate but no-one works in isolation in a company and there are all sorts of subtle human interactions to consider. What’s best for the individual is not always best for the company. Is it worth trading a bit of your productivity for others’ morale? I don’t know, but it’s something to think about.

    –Tim

  21. Kirsty says:

    Mosh, I could not agree more. After nearly 20 years in the business, my back and neck were in such a bad state that I could not look up at the sky, could not properly drink from a cup or glass, could not push open a door (and I always kept myself generally fit and strong with weight training, martial arts and cycling). I also had lower back issues with 2 discs which was incredibly painful and debilitating. Chronic pain is dehumanising and one can be quite bad tempered and grumpy to all around.

    Many of my colleagues are/were in a similar fix, including some who had to have operations and (according to their surgeon) are lucky to be walking. Or the young web dev I know that can barely walk and is in constant pain (and he is only 26!). Since I am a lousy typist, I didn’t get RSI or carpal/cubital tunnel, but that is also common.

    I had to take a year off (went sailing!)- in fact I thought I’d never be able to develop for a living again. Then I came back and did a year for a friend’s company working from home, where I could stand at my desk. Since then I have been mostly Ok, but as a contractor, I can have lots of long breaks from programming work. In the last job I had before moving to a new country, I had a huge fight with one of the managers when he wanted to insist we all had the same (new) chairs. By sheerest luck the old worn one I had did not cause my back problems. I lost, and I ended up with back/leg issues that meant I could not run at all, not even a few steps. I quit that job early, almost entirely for that reason – the damage and the management’s utter lack of understanding and disregard for my health.

    Now, over a year later, and after most of that year off, I am just about fine again (if I don’t push it) and retraining myself at home (using various resources inclusion your wonderful course) to get bang up to date and get a job once more.

    And yes, the first 4-5 hours are the productive times, I utterly agree. And no matter *what* the profession, one can only be fully effective for about 4 hours per day – writers, musicians and artists all agree (though they are worse for not being able to stick to it due to passion/inspiration!). I try to arrange to do only “admin” after lunch, and after 4pm I call the “negative work zone” where normally, I do more harm than good! Whereas at 8 or 9 the next morning, I solve the issues easily and elegantly in a very short time.

    Thank you for this post and for your excellent courses. I do tend to do a few things my own ways (I’m long accustomed to refactoring as I go, and tend to do that automatically) but even an very old hand is learning a lot. You set the standard for online training – and in fact do it better than any “in person” course I ever did!). Keep up the good work!

    • Kirsty says:

      Although, with references to the chap who is not a morning person and has his best hours in the afternoon – I meant to mention that. Not everybody has the *same* productive hours, they turn up at various points of the day – but I’ll stand by that we can’t do more than 4-5 hours *effective* work in a day.

      If we do that, then all the “mucking about”, facebook etc can happen in our own time, as it should. It just takes discipline (from the employee) and trust (from the employer). Most grown adults can manage this, if they have the respect and understanding of the bosses and are onto “hovered over” and checked upon and co-erced!

      It is about trust. I am a professional. It is my professional pride to do a good job. Longer is simply NOT better. It’s just that physical presence at your desk CAN be simply observed and measured, therefore it is. I have worked better and harder and more effectively for companies the less they enforce and observe and the more flexible they are about working times.

  22. Karlo Tamayo says:

    I used to work in chemical/biological laboratories before software. I found that many of the pains of repetitive work could be remedied by regular strength training and getting work done by a trained massage therapist.

    A 5 hour day, as some have pointed out, will work for some and not for others. I personally can see the potential for great benefits if those 5 hours are an intense session of sheer productivity, though there might be days when the 8 hour day might be good to go at a slower, more contemplative pace.

    Good post Mosh!

  23. micky says:

    Hi Mosh,

    I can relate to whatever you mentioned.For me not taking a break for long hours actually doesn’t help.
    But due to work pressure I am not able to take frequent breaks.

    Also listening to music helps relax.

  24. Justin says:

    So true Mosh! My productivity drops considerably after long hours in front of the PC.

    I have now made it a rule that I will no longer do work after hours simply because concentration drops and I end up having to fix the things I did the night before.

    5 hours is ample and should be the norm!

  25. JBrodnax says:

    I’d second that advice. the ten minutes break every hour is something I learned almost 30 yrs ago and practice faithfully to this day. I will unabashedly say it has provided a noticeable improvement in my work life as a developer.

    Good article, thank you.

  26. govind says:

    Great article, I also follow your videos for learn programming concept and new tech in .net programming.
    This article is very helpful for me.
    Thank a lot…

  27. With you on this one Mosh. If I worked for myself there would be no way that I would do more than 5-6 hours a day.

    I did it for many months, and those were some of the most productive months I’ve had.

    Worked in 30 minute pomodoros with 5 min breaks. Would do about 6-8 pomodoros before lunch, then take a nice long break for lunch and a long walk, and then do another 2 – 4 pomodoros after lunch.

    The amount of work I produced was staggering.

  28. Ty Yanushka says:

    Good stuff, Mosh.

    I’ve had 4 surgeries for RSI related injuries. I’ve programmed professionally for 23+ years and messed around on computers some before that (when they were newish). Taking breaks is important when programming for all the reasons you say and I need to get better at heading that advice. #1 is the biggest and hardest hurdle to overcome. When you feel like you’re being watched and every minute counts to productivity you will work longer and not take breaks…that is definitely the sign of a bad employer if they let you do this. My current job is great though I still struggle to take breaks because programming is not just a job but also fun so time can slip away.

    Thanks for the posting!

    Ty

  29. Matt says:

    Good article. However I think that the time you’re most productive is based on your personality. I find that I’m most productive after lunch and in the early evenings.

  30. Praveen says:

    hey Mosh , Loved your angular2 course. can we start using it in production ?

  31. Armand says:

    Great article!! Thanks a lot Mosh Hamedani for such a wonderful and informative post.

  32. Bruno de Lima says:

    You are totally correct!

  33. Randy says:

    You are exactly right Mosh, and thank you for bringing this up. I worked in vocational rehabilitation during my career and met too many people with Carpal Tunnel and other RSIs.

    It is a physical issue, but can become an emotional issue very quickly as you suggested in your words.

  34. Anna says:

    Well said!
    Sometimes easier said than done – we do have responsibilities to others – in terms of family, or finances, but I agree. Get out of that type of situation as fast as possible.

    I spend 5 hours physically typing – but at least 2-3 doing doing prep work. My prep work includes: reading materials, researching new topics, understanding fundamentals, reviewing previous work, and planning projects or objectives.

    I truly believe a happy programmer is a autonomous and productive.

    Be happy – always!

  35. David says:

    My wife helps me to talk through code problems and design ideas and we do just what you recommend in this article. Get up every 45 min to and hour and meet in the kitchen, grab a beverage and chat for 5-15 minutes while walking around and doing other things and then get back to work. I’ve also found that taking my laptop to different work areas over the course of the day helps tremendously. I’ll work at the breakfast bar for an hour or two, then take my computer back to my desk, then hang out on the couch for a bit, then back to the desk. That really helps me because I’m not falling into the same repetitive positions all day.

Leave a Reply