Debugging Tips

Is there an error message to explain the issue? If there is copy and research to see if someone else has had a similar issue online before. Be mindful that your issue may be an edge case, and similar errors might not relate to yours. In this case it’s good to make use of google’s search syntax to include keywords to narrow down your search for a solution.

If there’s no error message make use of console.log (depending on language) to visualize the variable or data you’re using. You can use this at different lines in the code to show the exact state of a variable or data.

If the problem isn’t related to variables or data, begin to comment out lines of your code to narrow down the issue to a specific area. It might be you can revert back to console logging once you have a good idea where the issue is.

Make sure you’ve read documentation online relating to the issue you’re having, if you’re using a specific plugin or package or language. Compare your code to official examples online.

If the documentation isn’t comprehensive enough, or you think a plugin/package isn’t working the way it should, collect the necessary information you need to contact the developer/publisher. This will include examples of your code, any errors you might have, and what you’ve tried.

If none of the above has worked, try to explain the issue and what you’ve tried to yourself in your head. Sometimes explaining the process reveals a critical piece of information you may have missed.

If all of the above has failed, you can now escalate the issue to a senior member of the dev team. Much like a plugin creator/publisher, make sure you comprehensively put together an explanation of the issue. This includes any errors, unexpected results and what you have already tried to solve the issue. If you think you’ve found any relevant sources online then including these will be helpful as well.

A short summary of the steps:

  • If you have an error make sure you look for solutions online
  • Try to console.log the message in various steps
  • Make sure you read the documentation of the issue you are facing
  • If all has failed, raise the issue to a senior member of the dev team.

This text was inspired from this Reddit post.