Evan Harmon - Memex

Debugging & Troubleshooting

Be methodical

  • Don't try too many changes at once since you won't know which change is causing the problem.

Isolate the problem

  • Comment out other things
  • Even better, isolate what you are troubleshooting in a totally different program, codepen, etc.

Useful debugging features in IDEs and editors

Run to Cursor

Step over, step in, step out

Go backwards? Visual Studio can

Watch Expressions

Breakpoints

  • where the program will stop and then display a bunch of data about the state of variables, etc.

Conditional Breakpoints

  • E.g. to stop at a certain loop iteration

3 Kinds of Errors

Logic Error

Syntax Error

Runtime Error

Use print()

To show the value of variables as it executes

To show when a program gets to a particular point

Global and local variables

Whitespace Errors

Matching parentheses, brackets, etc.

Order of operations

Google

Quoted error message

Ask others

r/learnprogramming

Stack Overflow

Code Newbie Slack

Ask good questions

  • List software versions you're using
  • I think LaunchCode has a link about this
  • I think ATBS has a section that's good
  • Be nice, clear, concise
  • Post complete error message and code and specify where/when the issue occurs
    • Is it repeatable?
    • gist.github
    • After a change in code? What change?
    • Does it occur after a certain action? What action(s)?
  • Explain what you have already tried
  • https://superuser.com/help/how-to-ask
  • Explain ultimate goal

Rubber Duck Debugging

Debugging & Troubleshooting
Interactive graph
On this page
Debugging & Troubleshooting
Software Bug
Be methodical
Isolate the problem
Useful debugging features in IDEs and editors
Run to Cursor
Step over, step in, step out
Go backwards? Visual Studio can
Watch Expressions
Breakpoints
Conditional Breakpoints
3 Kinds of Errors
Logic Error
Syntax Error
Runtime Error
Use print()
To show the value of variables as it executes
To show when a program gets to a particular point
Global and local variables
Whitespace Errors
Matching parentheses, brackets, etc.
Order of operations
Google
Quoted error message
Ask others
r/learnprogramming
Stack Overflow
Code Newbie Slack
Ask good questions
Rubber Duck Debugging
https://en.wikipedia.org/wiki/Rubber_duck_debugging
https://rubberduckdebugging.com/
Just talk it out loud and there you go! : r/ProgrammerHumor
Root Cause Analysis
This site is no longer active. If you are the owner of the site, please update your subscription here.