DEV Community

Ben Halpern
Ben Halpern Subscriber

Posted on

What's the best thing to do when you've run into a debugging dead end?

So you've hit a wall. What is the best course of action in this situation?

Oldest comments (56)

Collapse
 
thatonejakeb profile image
Jacob Baker

Turn off the computer and go for a walk.

Collapse
 
seniru profile image
Seniru Pasan Indira

Good answer, sometimes time can give you the solution

Collapse
 
drewtownchi profile image
Drew Town

This is the easiest and best thing to do. Let your brain work away from the screen. The amount of problems I've fixed by not working on them for a bit is staggering.

Collapse
 
ronaldoperes profile image
Ronaldo Peres

Yes, this is one of the best thing to do.

Also if you get stuck like for 20 minutes, ask a friend for help.

Collapse
 
kmwill23 profile image
Kevin

Sleeping works too! And video games.

Collapse
 
sonyarianto profile image
Sony AK

keep searching on Stack Overflow hahahaha, phewwwww

Collapse
 
nestedsoftware profile image
Nested Software • Edited

I think this summarizes my usual process for debugging tricky problems:

  • When working through various scenarios, make sure to carefully document each step. Make sure to alter only one thing at a time and check all possible combinations of things that may be causing the problem.

  • Break the problem all the way down to its fundamentals - sometimes that may mean starting from scratch and adding code bit by bit until the problem manifests itself.

  • Take a break: It's amazing how new ideas can come along when you're taking a walk or are in the shower!

  • Research: Look for answers online

  • Ask for help: Ask someone who may be able to help, either online or in person

  • Workaround: Is there some way to solve the problem without attacking it directly? Maybe there is a way to solve a slightly different problem that will still produce the desired results, or at least get close enough to get past the current bottleneck.

Collapse
 
perigk profile image
Periklis Gkolias

Go for a walk.
Then start thinking about potential scenarios that might cause the failure.
Then try to prove your hypothesis

Collapse
 
karfau profile image
Christian Bewernitz

If you dont want to leave your train of thoughts by leaving the desk/computer (yet):
Use the help provided by rubber duck (can also be a text editor or colleague if you prefer):
Explain everything you did so far, as you would need to in a stack overflow question or thorough bug report.
In most cases I do that, the missing piece get's obvious.
If you have the patience to write it down and it doesn't help you can of course ask that question here or somewhere else, or file that bug...

Collapse
 
peacefullatom profile image
Yuriy Markov

Take a break. Do something else.

Collapse
 
kayis profile image
K

I am going to solve this problem with weed

Collapse
 
tarasnovak profile image
dataPixy πŸ§šβ€β™‚οΈ

I highly recommend a cup of jasmine tea w/honey & meditation sess.

Collapse
 
buphmin profile image
buphmin

Ask someone else too look at the problem with you. Sometimes they will see something you didn't since they don't have a ton of assumptions on how it will work.

Collapse
 
fultonbrowne profile image
Fulton Browne

Turn your computer off, scream, get some coffee and listen to music until you solve your problem.