There are days (at least in my life) when you are sooo tired but you must finish the program, build the release, ship the product, etc. I'm talking about loong nights full of coffee, 4-hour sleep-time and a whole lot of work to be done. How do you keep yourself productive in such days?
I try as much as possible to have as few of those days as possible. That way, when I need to do them, the ability is there.
To do this:
- Anticipate when the next set of those dates are going to be. If you've got a big release in a month, do what you can to set up automated tools to decrease time between runs.
- Don't work more than 8 hours a day on a regular basis. If you do that, then when it comes time for the big sprint, you'll find you're already running faster than you should. You'd be that guy in the marathon who starts strong, ahead of everyone else, for the first ten miles, but then hits the wall something horrible.
- Try as much as possible to make sure that the requirements for whatever end date are reasonable. It may just be that you're being asked to do too much. If you're always working 14 hour days but getting paid a regular salary, they're trying to get the work of two people out of you.
- Conversely, if you find yourself working 14 hours a day but everyone else is working 8 and getting the same amount of work done, it may be time to get some training. I've worked with people who are just slow; they take at least twice as long as everyone else to do things, and that slowness translates into them working long hours. They need to get faster, there's nothing else to it.
- Get a hobby. If all you do is live, eat, and breathe code, then you're doing too much work, and not enough play. Play is essential to maintaining sanity, whether it be computer games, learning painting, dancing, etc.
I don't. I go home because I'm tired, overdosed on caffeine, stressed, making mistakes, can't think straight, snappy etc.
It's expected by your management, then I'd really have to consider my options. And it's probably illegal where I live too...
I just discovered energy drinks.
Aside from sometimes making my right arm feel like it's not attached to my body anymore, and the occasional headache... they sure keep me awake.
Unless I'm working on something I deeply enjoy, however, they don't necessarily keep me productive.
Don't let a project slide this much in the first place!!! Never been there never want to go there, planning is the place to stop this happening
Miyagi father always say..." Best way to avoid punch, no be there."
In other words, build your release and engineering process to avoid this situation. It should never be status quo. If you're in that situation, man up to it and go get some sleep and come back when your head is clear. There is very little in the software world that can't wait another day. If it's mission critical (like a pace maker), would I really want an over-tired over-caffeinated engineer working on the code? Anyone?
Get some rest. You'll get more done when you're refreshed, even considering the time lost to sleep. Especially considering how error-prone you are when you're tired.
Do some exercise
- Take a walk
- Go for a jog
- Take up meditation
If you're really feeling the need and you really want to start doing something that will have long term impact and usefulness, try getting in to the tibetan rites which are a fantastic series of exercises for clearing the head and getting you back on track.
I have a small trampoline next to my desk. It helps to be able to think about something different for a moment plus it gets your heart rate up a little.
In addition I keep a task list for every day. If it is very late in the evening I take all the undone tasks (except for one) and write them on the list for the next day. That makes it easy to "finish that last little task" more quickly (because there is only one left).
A good expression I was told in response to the same question: "Slow down, you'll go faster."
Just keep your fingers moving. As long as the fingers are moving, work is being done. You may have to move more slowly, to avoid making mistakes, but that's how it goes. Working while exhausted requires much more discipline.
I learned in my first job out of school that if you don't go home and sleep when you are exhausted, it will take twice as long or more to get the work done because you make mistakes (often very bad ones) when you are too tired.
When you have stared at the screen looking for a problem you know you could find in 30 seconds if you could just focus, it's time to tell your boss that you need to get some sleep. If it really is a time crunch, offer to come in earlier than normal instead of staying for another two hours (and accomplishing 15 minutes worth of work).
If everyone must be there for scheduling reasons, offer to go pick up dinner for everyone, just taking a break will often help. Even a fifteen minute nap can help.
I remember once having a boss who thought we should be able to come in a 6 am and work until past midnight and not take any food breaks at all. Eventually we all revolted and insisted. We should have done it at least a week earlier. But if you are that tired so are your co-workers and going to the boss in a group can help convice him. you need to take a break.
If you know a crunch time is coming, get as much rest as you can immediately before it starts. If you know that Friday is the big day when things must be done, make sure to leave earlier on Wednesday. That way you can do the sprint Thursday night if need be.
If you are too tired at work because of your own lifestyle, not a work schedule induced exhaustion, then consider cutting back on the late nights during the week.
If you always work more than 8 hours, stop doing so, especially if your co-workers do not. Exhaustion is part of why it is taking you longer to do things. Remember, industries din;t go to the 40-hour wrok week back inthe beginning of the 20th century becasue they wanted to attract employees, they did it because they wanted to cut costs and tired people make mistakes and cause rework and get injured (I'm talking about when factory workers started working a 40-hour week)and that's expensive.
If a work place is so bad that you can't ever work a decent schedule, it is time to leave.
When you're tired, your productivity will go down, no matter what you try. There is a simple trick, which means taking a break of an hour or so: go to sleep! Keep the light on, lean back in your chair and try to relax. Close your eyes and try to get into a state of light sleep. This works best if you didn't take too much caffeine. (so, no cola, coffee or tea!) If you did take coffee, you might stay awake a bit longer but you will also end up sleeping deeper. After 30 to 60 minutes, your alarm clock should wake you again and hopefully you've rested enough to continue for another 6 to 8 hours before you need your next nap. This could allow you to stay awake for three days or more before you'll end up being too tired.
Do eat regularly, keeping track of your blood sugar level. If this level gets too low, you will become more sleepy and drinking something with sugar in it should give you a bit more energy. If your blood sugar level gets too high, it's not good either in which case you could do some exercise to burn some of it away again.
And remember, when you do get a chance, take a long rest! Sleeping 12 hours or more is a good thing at that moment.
A couple of thoughts:
1) Remove distractions - turn off the phone, don't twitter, close email client.
2) Sounds funny, but don't get too caught up in the fact that you have a lot of work to do in a short time. You can end up thinking about it too much which detracts you from actually doing the work.
3) In general try and avoid heroics. In the long run it isn't a sustainable way of working.
Take a 15-20 minute sleep at lunchtime (no longer, you won't want to wake up). Taking vitamin B (as a multivitamin or on its own) after lunch will stop afternoon tiredness, along with avoiding wheat for lunch. There's also the usual concoction of Ginseng, Ginkgo Biloba, Green Tea and so on.
If you have strong will power then low GI snacks (fruit, nuts, vegetables) spaced out during the day also help to stop blood sugar surges and dips.
I find breaking up tasks into small to-do's really helps. This way large projects can be broken down into digestible chunks. Anything that takes less than 1 minute - get it done straight away.
I use an app called 'Things' on the mac to manage all my life / project to-do's in one place. It helps to remove all the garbage from your head - switch off a lot quicker when you get home! i.e. sleep like a baby...
Sleep. Relax. Have a nice nourishing meal. You're not RoboCop. You can't go forever. I find my brain functions well for a long time, but then it starts to slooooowwwww dooooooowwwwwwwnnnnnnn and no matter how much I try to code more, I feel like I am getting less done, while taking more time. I find balance is the key.
I usually try to focus on bugs, when I am really tired. This is an activity for me, that doesn't require to be very creative. I follow simple routine:
1) test
2) try to decrease area, where the bug may be
3) put some more diagnostic information in the area
until I find the error and correct it. Then I go to the next one. It's funny, because I can work that mechanically only at times, when I am really tired and close to oding from caffeine and nicotine. But I get results from that and it's nice, near trance state, where I don't think to much and just go on autopilot.
Of course, it won't help with those really nasty heisenbugs and places, where design flaws appears. But I can get rid of most of the bugs, even those harder to spot and find. And it's good thing at the end of a project, where mostly you must remove as many bugs, as it's possible and not add new features. You just have to survive until boss says, that we are shipping and then you can go for a nap ;-)