Academic Resource Center

Debugging Best Practices

Updated on

Advice

  • Reproduce the problem. This allows you to go through each step to try and recreate the problem
  • Use in-line comments. This will allow you and others to understand what was coded in non-technical terms
  • Check the line the error shows and check the lines above it to ensure that proper syntax is there. Sometimes, it can be as small as a semi-colon missing
  • As you code, save your work often. This ensures that no bits of code that was previously put in is gone

Helpful articles for various languages

Debugging Best Practices

Topic Description Link (if applicable)
Advice; Reproducing the problem Reproduce the problem. This allows you to go through each step to try and recreate the problem. N/A
Advice; Comments Use in-line comments. This will allow you and others to understand what was coded in non-technical terms. N/A
Advice; Lines Check the line the error shows and check the lines above it to ensure that proper syntax is there. Sometimes it can be as small as a semi-colon missing. N/A
Advice; Saving As you code, save your work often. This ensures that no bits of code that was previously put in is gone. N/A
Debugging for C# This article gives examples and best practices for debugging within C#. https://blog.airbrake.io/blog/debugging/debug-best-practices
Debugging in C++ This article gives examples and best practices for debugging within C++. https://visualstudiomagazine.com/articles/2016/10/20/cpp-combine-debugging-strategies.aspx
Debugging in JavaScript This article gives examples and best practices for debugging within JavaScript. https://www.digitalocean.com/community/tutorials/js-debugging-js-best-practices
Debugging Frontend This article gives examples and best practices for debugging the frontend. https://clarusway.com/frontend-debugging-techniques/?srsltid=AfmBOopRXTBEi_98h_rCV_UcWzgKL1CGN8NPvVzVvn9cCpCNqnwyw84r

Need More Help?

Need more help with your debugging? Join an office hours session or workshop! Try the Python Basics workshop or the Basic IT office hours.  Click here to see the full schedule of office hours and workshops.

Previous Article Use your Programmer Mindset: Breaking Down a Coding Problem (with Video)
Next Article DAD-220: Modules (with Video)
Have a suggestion or a request? Share it with us!