Hey.

Welcome to Coditate a wellness site for programmers designed by the TRMJ team at CTP and the HTML5 UP template
Content by Sophie DeBenedetto

Isolate the problem

You're staring down a nasty bug in your code, your program just won't do what you want it to do and you don't know why. The first step in dealing with an issue like this is to isolate the problem.

  1. 1. Identify all of the code that might be responsible for the problem
  2. 2. Pare it down starting with one line of code then gradually re-introduce the remaining code
Next

Experiment

Don't be afraid to try different tweaks and changes to your code, just to provoke different behavior. This can help reveal the real underlying problem, or at least give us insight into what that problem might be. In order for experimenting to be helpful though, we need to have a clear understanding of what we expect to happen when we make specific changes to our code.

Next

Understand Your Expectations

One way to simplify a complex problem is to clearly define our expected behavior.Ask youself: "Why is this a problem? Exactly what behavior am I seeing that I shouldn't be seeing? Exactly what behavior am I missing that I should be seeing?" We need to clearly define the parameters of the problem if we are going to solve that problem. Once we start experimenting with new code, we need to clearly define what we expect to happen with each change we make. Going back and forth between writing a line or two of code, and viewing the results of our changes, we can can gain a better understanding of the impact of our code.

Next

Ask Questions

There are some resources though that are available to everyone:

  • - Google it! Developers at all skill-levels Google things every day. This is a real and valuable programming skill and you shouldn't shy away from it.
  • - Ask a question on a forum like Stack Overflow. Stack Overflow exists because people want to help you solve your problem. Use it!
  • - Go to a meetup. There are lots of excellent meetups geared to beginner programmers, as well as meetups that function as study groups with people volunteering to answer questions and help out. Get out there and meet some other programmers!
  • - Ask a friend or classmateIf you're taking an online or in-person class, talk to the other humans learning to code with you! They almost certainly don't bite and are very likely to be struggling with questions of their own too.

Next

Rubber Ducking

By articulating the problem, you gain an understanding of what your program does, vs. what you expect it to do, and why it doesn't do what you expect it to. Beyond that, by taking a step back and explaining the problem to someone else, you look at it from a new perspective and often gain a new understanding of the issue. There are lots of ways to engage in this practice.

  1. - Talk to a friend or roommate--they don't have to know anything about code
  2. -Talk to a co-worker or classmate
  3. -Talk to an inanimate object--like an actual rubber duck!

Next

Take A Break

When you're stuck, frustrated and confused, you have two options for dealing with those feelings. Ignore them, push ahead and exhaust your self . Or, take a break!

Next

Say Hello.