Dr. Axel Rauschmayer is a freelance software engineer, blogger and educator, located in Munich, Germany. Axel is a DZone MVB and is not an employee of DZone and has posted 246 posts at DZone. You can read more from them at their website. View Full User Profile

Programming: the benefits of taking a break

07.14.2011
| 7794 views |
  • submit to reddit

This post lists several benefits of taking a break during programming.

  • You work smarter, not harder. Once, I worked really hard at a feature. For two weeks, 12 hours a day, I put in a lot of effort. After those two weeks, I took a break and came up with several ideas that made much of the work unnecessary.
  • You think more clearly. Being tired has a similar effect as being drunk. At the end of a day, I often kid myself that I’ll just get this one thing finished quickly to have a fresh start the next day. In reality, I usually need to clean up yesterday’s messes then. If instead I find the discipline to postpone, it only takes me a fraction of the time to accomplish the same task – with better results.
  • You can be your own pair of fresh eyes. If you want to write quality code, code reviews (including their extreme version, pair programming), are invaluable. If I let things that I have written lie for a few days, I have forgotten enough about them that I approach them with a fresh mind. I’m almost my own code reviewer, which allows me to really improve the understandability of my code.
  • Being nice to your body is good for your brain. Don’t forget that the latter is part of the former and adheres to biological principles. Especially people working with computers tend to focus too much on their brain and neglect the rest of their body. The brain needs oxygen, rest and nutrients to function at optimal capacity, so you need to breathe, sleep and eat properly.
  • Communication is a different way of learning about a problem domain. You can view programming as solving a puzzle in a problem domain, as finding the best tools, techniques, and libraries to write your code. If you take a break from coding, you can attack the problem domain from a different angle – by discussing it with other people. It doesn’t matter whether you do so via talking to face to face, via social websites, via email, via Twitter, or via other tools. Swapping experiences gives you a new perspective on your code without doing actual coding. In a way, web searches are a uni-directional way of communicating, but they have become too much part of the coding routine to be considered a separate activity.

 

From http://www.2ality.com/2011/07/taking-break.html

Published at DZone with permission of Axel Rauschmayer, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Manuel Jordan replied on Fri, 2011/07/15 - 9:52am

This is an excellent article

I want share my 2 cents. Is wise make some sport in the weekends, it is a valuable medicine.

BTW Stress=Cancer

Endre Varga replied on Fri, 2011/07/15 - 9:56am

I agree wholeheartedly! Even if I get just 1 hour less sleep than I need, it costs me a huge loss of creativity. 

Sreenivasa Majji replied on Fri, 2011/07/15 - 10:47am

This is an excellent article. Always attack the problem after a good night sleep, it worked very well for me for the last 16 years

Lund Wolfe replied on Sat, 2011/07/16 - 12:12pm

That's excellent advice gained from experience. It's about quality time, not quantity. When you can't find a good solution, take a break and do something else (or put the problem on hold and do some research to find patterns or tools that already solve this problem).

Your brain will continue to work on the difficult problem on the drive home or while you're sleeping. It often becomes obvious by the next day, and you've already worked through the potential failure points mentally so you aren't headed into a dead end or maintenance nightmare because you could only do one thing one way.

Gnu Skool replied on Mon, 2011/07/18 - 2:45am

Quite often I've sat there thinking Im just about to solve something, but never quite getting there - only to stand up and walk away and come back to it and see the solution right before my eyes.

Kevin Rodrigues replied on Wed, 2011/07/20 - 11:28am

Being tired has the same effect as being drunk. Couldn't agree more on this. Also many times it happens that you are stuck on a problem and can't find a solution. But then you are just doing something else like travelling back home or relaxing in the chair and suddenly a solution pops up in your head.

Complete Coding

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.