Top 10 Steps to Program Debugging & Problem Solving

chalkstart
3 min readFeb 17, 2020

--

I would like to give some useful tips I’ve learned over the years as an Electrical Engineer and Software Engineer for debugging/problem solving “anything”. This guide does apply a lot to engineering and programming, but I don’t see why one couldn’t use this information for any life tasks.

  1. Always start with running with what you “know” works, so decompose your logic until something does work correctly. This is probably inherit, but taking a few steps back and thinking about what you do know vs. what you don’t understand can really help solidify constraints to any problem in life.
  2. Read the error message(s)/warnings “carefully and try to understand what they are actually telling you. Don’t ignore something because you don’t feel that you have the capacity to understand something complex. Realize rather that the error message came from a human that wrote it for a reason.
  3. Break up all logic concepts into small pieces and follow the linux paradigm in that every function should do one thing and only one thing. One thing can be a little overkill, but it truly works. When I say one thing, it can be a “set” of things where each still do one thing. Although, there will always be the case where it’s just not economically feasible to break the problem into several pieces.
  4. Step away and take a 15–20 minute walk, you would be amazed how one’s brain thinks when they are “not thinking…“. Take if from Einstein, in that he did this a lot along with having much sleep and naps.
  5. If you’ve tested the same thing and had a similar outcome, stop now because you’re just wasting time. Rethink “why” things are the way they are and “understand” what’s going on. Researching something for 5–15 minutes could save 1–2 hours of headaches.
  6. Google and stack overflow are a programmers best friend. Another great tool for general mathematical concepts is wolframalpha.com, where you can access calculations to an entire slew of math, science, and many more questions. Stack overflow also has several other variants of their site such as meta overflow targeting different sectors of the S.T.E.M. divisions.
  7. If you’ve refactored and that led to a bug, then unfactor and you’ll have a solution fairly quickly. I recommend using the redo and undo feature in MacOSX (or Windows if they still have it). Although, you first have to “refactor” meaning rethink why you did what you did and come up with a more ingenious solution to the problem at hand. Refactoring and using composition (i.e. reusable components/parts) will help you deliver solid results and stay D.R.Y. as you build you code.
  8. Use the FORCE of intellisense when applicable. There are plugins/built in features that have capabilities to “tell you” when things make no sense. This goes along with reading the warnings/errors from the debugging console and trying to make sense of them. Several people are moving away from the full blown IDE’s such as Visual Studio or JetBrain IDEs for more compact and less bulky text editors such as Visual Studio Code or Atom. Although, Visual Studio Code has been growing significantly and has the near power of a full IDE now (blast from the past!).
  9. Ask someone that may know, or post online to stack overflow (the library in questions’ blog/discord chat channel) if the answer isn’t online. Never spend more than 1–2 hours on debugging something, without asking.
  10. Use your phone to do google searches, vs your PC. Google has better algorithms for searching via your phone (from my experience) since it pulls more relevant questions up.

For help solving/debugging programming issues, give us a shout at chalkstart.com. We have a very skilled team at chalkstart and can help you with whatever software problems you are facing.

--

--

chalkstart

Chalkstart is a Web Design, Software Development, & Marketing Firm with a focus on customized software helping businesses around the world.