Photo courtesy: lucid.me
Sometimes you spend hours or if not the entire day trying to find a solution that can fix a bug in your code, but might end up in causing a regression or not finding any solution at all. The same applies if you are trying to refactor your code or maybe add new features that might not work well with your existing approach. Needless to say, that is extremely unproductive.
This doesn’t mean you are not capable of finding a solution, but would mean that you lack enough sleep. According to National Center for Biotechnology¹, sleep deprivation impairs attention and working memory and it also affects other functions, such as long-term memory and decision-making. This impacts your ability to solve problems. Your brain needs rest. At times, going to bed and waking up with fresh mind in the morning can do miracles in getting those daunting bugs fixed.
Don’t burn out yourself, take enough breaks, get enough sleep and exercise every morning. You are a human being, you get exhausted, your brain seizes to function at it’s maximum potential when you are drained out.
Next time you find yourself burning the midnight oil with no sign of positive outcome, just hit the bed!