DEV Community

Nic
Nic

Posted on

Debugging by taking a break

We all know that if you're stuck on something, taking a break makes it easier to solve when you get back. I knew it too. And then this week I discovered I didn't know it. So this is a reminder to everyone who, like me, needs one from time-to-time.

If you are stuck, take a break

Any length will do.

If it's the end of the day and will wait until tomorrow, leave it until tomorrow. You will solve it in 5 minutes.

A 5 minute break can do wonders. If you're at home it's a good time to do a quick household chore. Your brain will work on the problem in the background and as a bonus, that household chore also gets done!

Longer breaks also work. Have you got something else pressing to do? Then do that and come back to this.

Are you trying to get just this one thing done before lunch? Take an early lunch and come back to it. You'll get it solved quicker and you won't be hungry.

You can also ask someone

You don't even necessarily need an answer. Just explaining the problem to someone can often mean you figure out the problem. You can get yourself a rubber duck or write it out, as if you're going to send it to someone or post it somewhere. You might well solve it before you've finished typing it all out.

Here's the reminder again:

Don't stay stuck, take a break

Top comments (0)