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.
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 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.
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.
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.
If you are following our directions and get an error message or other unexpected output, complete the following trouble-shooting tips:
pwdto 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.
It can be helpful to review the previous lessons because you might have overlooked something that you can apply to your current task.
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.
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.
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.
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!
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.