I tend to get exhausted mentally and can't really program more on most days starting at around 3 to 4 PM every day. From there I'll kind of just be out of it mentally and unable to produce code that isn't filled with bugs or start feeling mental pain.

I typically program from 9 to 12, take a 15-20 minute lunch break, then program until 330ish. I tend to get around 6 hours of programming work done a day. Then until 5 I'm exhausted and can't do anything. After that I normally log on late at night / weekends to run through a checklist to make sure productions working okay which takes maybe 30 minutes.

I've been praised for being a high performer and received nothing but excellent reviews but my manager has noticed I tend to not get much done around those hours and wants me to do more.

How can I improve my productivity so I'm able to get more work done at my job from 330ish to 5?

  • 1
    Comments are not for extended discussion; this conversation has been moved to chat.
    – Kilisi
    Commented Apr 7, 2022 at 3:39
  • 4
    Do you drink coffee?
    – Criggie
    Commented Apr 8, 2022 at 1:52

12 Answers 12


Six hours of solid and quality programming in a day is pretty decent. But if you're then producing sub-par work in the afternoon, some of your next day will be wasted fixing it.

Losing energy at 3 or 4 is also pretty common. One factor is lunch - try not to eat anything too big or heavy for lunch, as your body will divert energy into digestion. Also, try and get out in the fresh air for a bit in the middle of the day to recharge. A 15-20 minute break in the day is the bare minimum - you should try and get away from the computer for up to an hour (and try to avoid surfing or socialising on the phone, too - but it's okay to have a real conversation with someone).

If you still have trouble concentrating on coding, do other things:

  • Documentation - I know you said there isn't much, but why not get started? Document what you just code in the day, or even document other parts of the codebase (great way to learn how others are doing things);
  • Planning - think about what you need to do next, without actually writing code. Or scaffold out some tests ready for tomorrow;
  • Learning - spend some time reading articles and tutorials adjacent to your current and future work. Experiment in a fresh project separate from the one you're working on.

Burnout and management expectations

I just read your new comment:

I've been praised for being a high performer and received nothing but excellent reviews but my manager has noticed I tend to not get much done around those hours and wants me to do more. I'm also burned out slightly lately because I was working almost 12-14 hour days + weekends for the past month to get a project done.

Yeah, as you're learning: working 12-14 hours a day for 6-7 days a week is simply unsustainable.

Really, even trying to push through your afternoon slump like your manager is trying is a recipe for burnout in the long run.

Coupled with the lack of current documentation, these are a handful of red flags to me.

One thing to say about that: not everywhere is like this.

  • If I take a one hour break for lunch or time away from the computer wont I be expected to stay later? Then I probably will just be more tired because I'll be staying until 6 or 7 instead of 5 Commented Apr 5, 2022 at 19:35
  • 12
    @softwaredev1 as the answer says, not everywhere is like this. Some employers care more about what you get done than when or how you get it done.
    – Seth R
    Commented Apr 5, 2022 at 19:44
  • 37
    Everywhere I've worked the expectation has been a 7.5 hour day - I typically worked 8.30 to midday, then from 1 to 5. Occasionally I would work a longer day, but then was able to either offset that by starting a bit later the next day, or getting out early on Friday. Sounds to me like your boss is wanting even more than that, and that is unsustainable.
    – HorusKol
    Commented Apr 5, 2022 at 19:45
  • @softwaredev1 what is the expectation for lunch where you work? You indicate that you work 9-5 with a short lunch. Maybe arrange with your boss to work 8-5, but take a full 1 hour lunch break. I arranged with my boss to work 7-5 with a 2 hour lunch break. I took a run during my long lunch, sometimes getting up to 8 miles in. I blocked the time as "tentative" on my calendar and would rearrange the exact time of my break to work around meetings with others. i.e. work took priority, but I had freedom to do so, so long as work got done. I was more productive in the pm and was healthier!
    – FreeMan
    Commented Apr 6, 2022 at 11:33
  • 2
    @FreeMan It really depends on the person - everyone is different. I'm most productive, for example, when I don't stop for a long lunch. I take really short 5-10 minute breaks and eat small snacks through the day rather than sitting down for a big heavy lunch all at once. Surely that's not for everyone, of course, but I think the point is that everyone needs, to some degree, to figure out what works for them.
    – J...
    Commented Apr 6, 2022 at 13:15

Avoid burnout and don't stress yourself out about not actively working all 8 hours of the day.

The average UK office worker only works for <3 hours per day

If you have a good employer, they'll care more about what you accomplished than how long you were actually working to accomplish it. Programming can be mind-melting and all developers know that they have some days where they're incredibly productive and in the flow, and other days where they can barely think straight. If you push yourself every single day and don't listen to your body/mind telling you it needs a break, you're guaranteed to be less productive in the long run.

  • 14
    Exactly this. I have days where I hit the groove and am in the zone solidly all day. Then I have days where writing "Hello World" would be a chore by 3pm. It's not an exact science but some days are better than others. Sometimes a good night's sleep, a lie in, and a chill (coding-free) day after several heavy days is enough to recharge you.
    – The Betpet
    Commented Apr 6, 2022 at 8:07
  • 5
    Humans are, individual variance aside, not equipped to work hard for more than around 4 hours per day. This is both physically and mentally. Modern studies are increasingly showing that reducing work hours leads to higher productivity overall, up to a particular sweet spot. I believe there is a decent argument made for this in the book, "Utopia for Realists."
    – 2rs2ts
    Commented Apr 6, 2022 at 21:02
  • < 3 Hours a day. Even less if WFH
    – solarflare
    Commented Apr 12, 2022 at 0:11

You shouldn't improve your productivity. Your productivity (according to higher-ups) is already great. Your manager should adjust his attitude, as just pushing you will either burn you out or make you move company. However their attitude is not something you control directly, so lets focus on what you can do. There are a few different things you can do:

  1. Spread the work more evenly. You are saying you take a 15-20min lunch break. That's super short. Take time to eat, and then go for a short walk outside. At least for me that helps with the after-lunch slump, together with the espresso :)
    Then also take short breaks during the day. Get up, do some stretching, grab a cup of your favoroute beverage, find out what your co-workers are doing, ... whatever you feel like. Again, that's not being lazy, that's tending to your ability to be productive.

  2. Ask for more responsibility. You say you are junior and don't have much documention to write or admin tasks to do. While I don't get the connection between junior and not writing docs (you write code, you should write docs), again that's just how it is at your company. However you got good reviews - ask for responsibility. Maybe you can get involved in design or take responsibility for an existing project, thus getting more tasks that require communication and other "non-code-work" (though I wouldn't call those tasks less taxing, just differently, which is good).

  3. Learn. Read stuff or explore patterns/frameworks/... that might help with the kind of tasks you are currently doing. Not necessarily after 3pm, your manager will also complain as that's not "productive", as the pause weave it into your day.

And you mentioned having done a lot of WEs and overtime: My take is don't do that. Sure it's necessary at times, but it needs to be an exception. And it's only an exception if you don't do it as a rule. Which then also means compensate when it happens. Otherwise it will be normalized by your managers and just get more and more. You are valuable, obviously to yourself, but also to your company. Wearing yourself down with a lot of overtime destroys that value. Don't do it.

And if can talk to your manager or have to because they complain, just be factual. Say that you can perform well for that time, and doing more just results in errors and you wearing out - it's in the best interest of the manager to not do that. Don't let it get to you if they try to make you feel bad about it. You are in the right. Either they get it or they don't earn to have you as a "high performer".


Ironically, I would refer you to a previous answer of yours (emphasis mine):

Developers aren't factory workers. It is a tough job that requires thinking and downtime.

It is perfectly acceptable to need to have a break after coding for so long, especially when you are working to a high standard that is winning approval from your superiors.

Regarding your manager observing you are not productive in the late afternoon, and asking for you to achieve more in that period, I suggest you tactfully point out that you are consistently "praised for being a high performer and received nothing but excellent reviews" and that part of your 'process' is to work aggressively for 6 hours and then ease up in the afternoon, rather than cruise through the whole day. If you do this in conjunction with trying to incorporate some low mental load tasks such as admin, documenting/journaling your progress, planning your next days work or even some career progression (such as watching a conference talk or reading a blog) at the end of the day your manager will hopefully appreciate you are not slacking off.

Don't feel bad about not being able to work at 100% for 8 hours a day! Remember, work is a marathon not a sprint and you need to pace yourself!

  • Your suggestion of downtime isn’t nearly radical enough. Get away from your desk, go for a walk… do something that doesn’t require any mental effort for an hour and be invigorated.
    – Floris
    Commented Apr 8, 2022 at 16:56

15 min Power-nap is only thing that can regain me same level of focus.

Everything that @HorusKol mentions in his answer is also important but without nap or power-nap your mind will simple have very hard time to regain clarity and focus you would like it to have. It can last only 15 minutes and result would be amazing.


I dare to say that it's normal body need and that everybody needs it. Many big companies have embrace it. Research shows that many people literally sleep behind computers anyway and I believe that majority of others are simply not nearly efficient as they could be.

You may say - I can't do that in my work place.

I work in co-working place and I'm doing it every day around 1 - 2pm. I don't wait to be completely exhausted to do it because that would mean more mistakes to debug (I'm a developer too).
I don't care what people say; I adjust my chair in as much horizontal position possible, put my feet on cabinet, put some relaxing binaural bits and I stray away in my relaxing wonderland.

You can ask your boss to allow you to do it - this will give him what he actually wonts in the end - more productive worker.


In many countries this is common. In my country (Croatia / Dalmatia region) many shops have dual working time giving space for midday rest because if it's really not urgent than siesta time should be respected.

You work to live, not other way around...

  • 1
    I have been quietly taken aside and asked to try not to snore around then(!) Commented Apr 6, 2022 at 20:03
  • @user_1818839 than find place where you can relax. You do have at least 30 min break I believe, use it wisely. You can relax in your car if you can't find other place. I never said that snoring on job is normal...especially when others around you are working.
    – Hrvoje
    Commented Apr 7, 2022 at 8:16

Concentration is like a bucket

Per my experience (as a fulltime developer) concentration is like a bucket. If you use a lot of it, the content decreases, when you relax (mentally) it slowly fills up again. The evenings and weekend allow for 'filling up the bucket'. After a night sleep the bucket is more filled, which last you the first few hours per day, until 3/4pm. I have the exact same thing.

This is normal! Just as you don't expect heavy physical work to be done all day, every day, we do heavy mental work. We do very specialized mental-heavy work, we perform best when we're in peak concentration.

My suggestion is to dose it. Don't burn it all up and then wait till the end of the day. Use it like a resource you can deplete, which you need to spread out. Some possible solutions:

  • Work a day less. This is a luxury option which not everyone can do, but I was of the opinion that I could do the same amount of work in 4 days as I could in 5 (instead of 5*80% -> 4*100%). I was right. Did cost me a lot of my vacation hours to "experiment" this, but after a few weeks I could show my boss my work didn't decrease. Less hours for same pay was an option. Day less of emptying the bucket, day more to fill it. Worked wonderful
  • Say "No" to additional workload. There is only a day per day, be mindful of how much you can do. Having 17 tasks on your mental to-do list are sneaky consumers! Do a few things at the same time, complete them as much as you can before starting something new. If you are asked to do something else, ask what you should drop. "I'm currently at my max, what would you like me to pause until this is done?" is a very healthy thing to say. We often tend to say yes to keep people happy, but you can't pour from an empty bucket. And your bucket is your responsibility!
  • Differ workload. Instead of programming 8 hours per day, maybe halfway through the day do something else. Work through some e-mails, write some documentation, clean your hard-drive, etc. Something concentration-lite.
  • Be mindful of hobby-programming. Programming at home can be fun/ interesting/ educational, but also depletes the bucket. I'm not saying "don't", just to be mindful of it.
  • Eat something small+healthy. A little extra energy around 3pm might give you a little bump. Be mindful of eating a little less for dinner if that is something you need to think about.
  • Be mindful of coffee consumption. For some people saying this is blasphemy, but coffee doesn't perse help you. I like to see it as if it borrows some energy from an hour in the future for now. But that means that in an hour you run short on energy and need more coffee now. Please note that this doesn't work like this for everyone, but I reduced my coffee to one when I wake up and one after lunch for the after-dinner-dip. After a rough 'detox' week drinking less gave me more energy.
  • Work some physical activiity in your day. We have a lunch walk of 15mins. It sounds like some hipster thing, but it does help. Some movement helps the bloodflow which is beneficial for concentration.
  • Work out in your own time. This is a generic "this is a good thing for everyone" type of suggestion, but some physical workout helps to balance the body. I had a tired mind, but not-tired body so I wouldn't sleep very well. Since I exercise twice a week for a hour that balance is better.
  • Sleep/eat well. Again a generic solution, but even though from the outside appears like "sitting and typing a bit", we do very intense work, that requires a good health to begin with.

All of these things help to improve your bucket size, but none will make it 100%. You have to find a useful way to spend your time to let the bucket fill a bit during the day.


The story used to be told of how Peter Swynnerton-Dyer was given the job of writing an operating system and promised he could do it in six weeks. After four weeks his colleagues started getting anxious, because he was spending all his time walking in the college gardens. After five weeks he came into the office and started coding, and after six weeks it worked. Tell this story to your boss: thinking is not a visible or measurable activity, and it thrives on relaxation, rest, and sunshine.


If you are anything like me then the clock doesn't start at 8am and finishes at 4.30pm.

Sometimes you cannot stop your brain mulling over a design problems, a bug, some requirements etc.

This happens in the shower, on your lunchtime walk, in the weekend during shopping etc. You probably don't even realise you're doing it.

You are basically working for the boss while off the clock.

Don't feel so bad about lapsing in concentration during office hours. All in all, I bet your boss gets more hours out of you than you are contractually obliged to put in.

You're an artists in your own rights and inspiration finds you, not the other way around. It just chooses odd times to come to you and often times keeps you waiting.


A personal note. This is pretty much exactly how burnout manifested for me. I started loosing focus in the afternoons, and the cutoff where it failed came earlier and earlier in the day, with time.

Focus is a vague word. It's the drive, abiltiy, grit, cleverness, programming-fu. Suddenly anything coding-related is mental pain, hard and not understandable.

Then I compensated with willpower and flexi-time hours, until it all snowballed to shit.

Take care of yourself!


It sounds to me like you're already achieving an excellent level of productivity. Many programmers like yourself are driven individuals who are always seeking to raise their own bar, and there is nothing wrong with that.

However, we are all human and in my anecdotal experience there seems to be a consensus that we may not be able to produce more than 6 to 8 hours of highly skilled labor per day. As others have mentioned, if you attempt to push this limit you may be able to make some progress but will quickly hit diminishing returns and begin making mistakes. And then these mistakes are issues you will need to rectify the next day, whereas it would have been better to never have written them at all and to have written them correctly the following day.

My suggestion would be that if you are meeting or exceeding expectations, allow yourself some breathing room. There is no pressure to produce more work in this situation. Instead, focus on honing your skills to provide the same volume of work but at a higher quality. A perhaps poor analogy is that if I were to employ a carpenter to build a table for me and paid for 50 hours of labor, I would rather have one extremely well-built and finely finished table, than two moderately well-built and competently finished tables. Less is more here, in some cases.

If you feel you must work between those times, dedicate it to work items which don't require your specialized skillset and therefore brainpower. Take this time to answer lower priority emails, plan out your next day, take notes, write documentation, etc.


Just a little hint in addition to other answers

Did you try test driven development (TDD) method?

  • It can reduce demand of your focus during implementation phase.
  • It can also reduce amount of bugs/mistakes in your code.

In short:

  1. Write a simple skeleton code: a class with an empty method producing empty/dummy return values.
  2. Write some (less means better) test cases to demonstrate that needed functionality does not work properly. (Which should be obvious at this stage but if test really fails then it means that test code works properly). At this step focus only on some very simple cases which should be very easy to implement.
  3. Write minimal amount of production code to make failing test cases pass.
  4. Write more test cases to cover more complex or specific corner cases. Same as before: these tests should fail.
  5. Write production code to make these tests pass.
  6. Refactor: If you just made all your test pass, think about how to beautify your code or how to make it simpler/clearer, more intuitive or more efficient.

When fixing a defect:

  • Start with a test case that reproduces the bug. (Demonstrates that it really exists)
  • Then you can fix it.

When you want to cover legacy code with tests to make sure your small change does not break anything:

  1. Comment all code line by line. Use IDE shortcut for it. Add some necessary code to make it just compile. (like return statements with a proper value)
  2. Write a simple test case to uncomment minimum lines of code.
  3. Uncomment minimum lines of code to make a test pass. It may end up writing some temporary substitute code -do not worry about it.
  4. Write next cases to uncomment next lines, then uncomment these lines.
  5. You can eventually realise that the temporary substitute code is written in a better/simpler way. You can just run the tests on the piece of code after and before the change. If it behaves in the same way, it means that you can just accept this refactor ;)

For more references please see: Robert C. Martin's books and tutorials.


Pro Tip that every programmers should know. You work 9 hours a day as a programmer but you only program for 5 - 6 hours a day. You can off course do more but then you are going to need more time away from the computer to compensate. You can absolutely 8 hours a day for 30 days straight and then maybe you have a psychotic episode that either leads to an office shooting or a nervous breakdown that forces you into a stint in some sort of psychiatric hospital. Depending on whether you are 20 years or 45 years old results may vary.

If your mental health is important to you and programming is something you want to do after you turn 35 then pacing yourself is important. Stick to 5 hours a day of pure programming and find other ways to be productive for the other 4. Things that you can do is...

  • Do impromptu meetings.
  • Practice social skills on pretty receptionist.
  • Fix random computers.
  • Help document code.
  • Read tech articles.
  • Watch tech YouTube content
  • Write tech articles on LinkedIn
  • Contribute to company blog
  • Refractor code
  • Answer questions on stack exchange (yes you do learn by doing this)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .