Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2016 18:51
Show Gist options
  • Save anonymous/b65cae924a2434a363f5385da70eeced to your computer and use it in GitHub Desktop.
Save anonymous/b65cae924a2434a363f5385da70eeced to your computer and use it in GitHub Desktop.
Standard debugging email help
Hello, I'm glad you contacted me asking for help. In order to help you help
yourself I have crafted this fine little automated email with information and
things you should try before asking for help. When you run into a problem I
want you to do the following things before you email me, and then email me your
answers. Doing this will most likely help you solve the problem on your own,
and will save me time in the long run. If after doing this you are truly
stuck and you can answer all these questions then email me your answers and
I'll help you.
1. Do you have a screenshot of the error you are getting?
2. Did you attach the code file(s) you are working on? You can also post them to https://gist.github.com/ for me to see.
3. Have you confirmed that every line of code is exactly the same as mine? Are
you running it exactly the same as I do? Have you watched the video for that
exercise?
4. What is your expected result? How is it different from what you are getting?
5. Have you pasted the error message you are getting into Google to see if there's an answer already?
6. Are you editing the file you think you're editing?
If you've done those basic checks first, then here's how to do more advanced debugging:
1. Write yourself an email explaining the problem and list each thing that
might be causing it. That's right, send yourself an email. It's weird but
this works *awesome*.
2. Go through each thing you think is causing the problem and try to rule it
out as the cause. Use a piece of paper to keep a checklist of what you've
tried so you don't repeat anything. Also make sure that you *undo* any changes
you made to your code while checking each item. You don't want previous
experiments to influence later ones.
3. Are you sure you're changing the files you think you're changing?
4. Have you written an automated test for it? Ignore this if you are a very
early beginner and don't know what an automated test is?
5. YOU CANNOT DEBUG CODE BY STARING AT IT. First thing, put print statements
that display a log message with the variables leading up to the problem area
and use that to trace through the code to find your error. Keep executing it
and adding debugging to see what's going on.
6. Last resort is to strip out all the code you can, or revert back to previous
versions of your code, until you have narrowed it down to the piece of code
actually causing the problem.
If you've tried all those things then email me back one more time with your
answers and what you tried and then I'll help you out. Thanks! And Good Luck.
Debugging is incredibly frustrating but very very fun and rewarding when you
solve it. It's my favorite part of programming.
@jt2190
Copy link

jt2190 commented May 12, 2016

Awesome! I may start using this myself. (Good artists steal, don't ya know.)

One sentence looks awkward to my eye, though:

Ignore this if you are a very
early beginner and don't know what an automated test is?

I'd use parenthesis instead of a question mark. (Full disclosure: I support the Oxford comma.)

Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment