Help Yourself Before Asking Others

When you are a part of an active community of experienced developers, like our Discord server, it can be tempting to ask for help before doing enough legwork on your own. If this becomes a habit, it will impede your own progress because you'll miss opportunities to strengthen your own troubleshooting skills. These skills are vital to becoming a successful developer, so let's look at some practical tips to help yourself before asking others for help.

Adjust Your Expectations

Most of our exercises and projects are designed to push you to your limit and force you to do some research on your own. This experience is similar to being assigned to build a new feature in your future job. When you first start on it, you will most likely not know how to complete all of it. Instead of holding on to this unrealistic expectation, adjust your perspective and get comfortable not knowing the entire solution when you begin.

Break Down the Problem

Break down the problem into small pieces and write it out in pseudo code. If you would like a detailed explanation of this step, read our Problem Solving lesson with this specific problem in mind.

Research a Sub-Problem

After you have broken your problem down into smaller sub-problems, you should research a sub-problem using your favorite search engine. As an example, you should research “return random item from array in javascript” not “how to create rock paper scissors in javascript”

If you are not getting helpful search results, read How to Use Google to Solve Your Programming Questions for tips on how to adjust your search criteria.

Examine Error Messages

Error messages are designed to help you get to the root of the problem. When you get an error, it is important to look at the entire error message to learn about the error and its location. If you do not understand the error message, copy and paste the most relevant line into your favorite search engine. You can also use the search feature in our Discord server to read how other people may have resolved similar issues. For even more tips, read our Understanding Errors lesson.

Triple Check Terminal Commands

If you are following our directions and get an error message or other unexpected output, complete the following trouble-shooting tips:

  • Starting at the beginning, re-read all of our directions.
  • Compare the directions to your terminal history to ensure that you did not skip anything.
  • Copy and paste the exact terminal command from our lesson to prevent typos.
  • Use the command pwd to confirm that you are in the correct directory.

If you are not following our directions, research it and confirm that you are using the correct command. You can also research the error message or unexpected output because someone else has probably experienced a similar situation.

Review Previous Lessons

It can be helpful to review the previous lessons because you might have overlooked something that you can apply to your current task.

Check for Typos

It is important to check your code for typos, because they can result in a wide variety of weird behavior and error messages. To help prevent typos, use VS Code's IntelliSense to complete methods, parameters, variables, etc.

Debug Your Code

When your code has unexpected behavior, the most important tool at your disposal is a debugger. This may sound like overkill, but look at all of your variables at every point in your code. Be assured that your code is doing exactly what you instructed it to do. The problem is that you are misunderstanding what you told it to do. Your job is to investigate where the misunderstanding is taking place. For even more information, check out JavaScript's DevTools or Ruby's pry-byebug.

Read Documentation Thoroughly

When you have isolated your problem down to a specific function or method that is producing unexpected results, you should read through its documentation. It is very common to learn that you misunderstood what the function/method does, its return value, or possible side effects.

Know When to Take a Break

It is time to take a break when you begin to feel tired, frustrated, overwhelmed, etc. At a certain point, persistence can be more detrimental than beneficial.

In addition, there is a very common phenomenon in programming where new ideas and solutions come to you after you take a break. This may sound crazy (until you've experienced it), so you need to trust us on this. Sometimes it comes to you when you are doing a mundane task, like walking your dog, cooking a meal, folding socks, etc. Sometimes it happens when you get back to your desk and start reviewing the problem and your code.

Talk Through Your Code Line By Line

The final tip is to explain your code line by line, which is a tried and true technique called rubber duck debugging. This may sound silly, so you need to trust us on this one too. When you take the time to examine each line of code, especially after taking a break, you'll be amazed how you'll see things that you did not see before!

Conclusion

Going through each of these tips can take quite a bit of time, but as you get more experience many of these will become part of your development process, which will save you time in the end. If you have not found the root of the problem, after working through each of these tips, it is time to ask others. However, asking others for help is not as simple as it may sound, so please read How to Ask a Technical Question.

Support us!

The Odin Project is funded by the community. Join us in empowering learners around the globe by supporting The Odin Project!