Photo by Aubrey Rose Odom on Unsplash
When you begin to practice programming for the first time, you'll encounter many challenges as a developer and one of them is errors. When this happens (Trust me, it will happen every single time), we use the method called the "Read, Search, Ask". In this article, we'll explore how this method will help you to solve the issue without going overboard.
Photo by Joel Muniz on Unsplash
The first step to solve the problem is by looking at the error message. What is the type of error? Where is the source of the problem? When you open Google Chrome console and looked at the message, you'll see a link next to an error message that will point you to the source code that causes a problem.
If you're lucky enough, the solution might be simple enough like typos in your codes or you forgot to close the brackets. Once you're positive that this is not the case, then let's move on to the next step.
Note: In Firefox console, there's a link which will open a documentation page related to a particular error that provides a thorough explanation. This is a pretty neat feature to learn more about the errors and possible ways to solve the issues.
Photo by Aubrey Rose Odom on Unsplash
The second step to fix the error is to research on Google. When you don't understand the message of the error, it's much quicker to just copy the message and paste it on the Google search and see where the results will lead you. For the most part, you'll see Stack Overflow on the top results and click the links that are relevant to your problem.
If that solved your problem, then awesome! You have solved a problem and you're one step away from being self-reliant - which is a very handy skill to have. Sooner or later, you'll find yourself googling a lot and that's very common among the developers. It's part of our job!
Notes: While Stack Overflow is extremely helpful, you shouldn't limit yourself to one resource only. Check out the GitHub issues, forums, and of course the official documentation for programming languages.
Photo by Austin Kehmeier on Unsplash
Sometimes, even if we do our best to solve the problem, there will be times when we cannot fix it on our own. At this moment, enlisting someone for help will be vital to find solutions to the problem. By bringing in a real person to look over at your codes, you'll discover your mistakes and depending on who's helping you, they'll also provide you with some tips and resources they use to solve the problems.
One thing that you should be aware of is to know when to ask for help. While the timing may vary from one person to another, a rule of thumb is if you did not fix the issue within 30 minutes, then ask for help. And how often should you ask? As much as you want. The more you ask, the more you learn.
Where to get the help?
- Your family, friends, or colleagues who happen to be a software developer
- Twitter - Use #100DaysOfCode and #CodeNewbie hashtags when asking for help and post an image of your code. You'll be surprised at how eager someone wants to lend you a hand!
- Stack Overflow - When asking a question, please follow the guideline outlined during the process of creating a new question. While the folks there will be happy to help you, they want to see that you have put some effort into it and explain the things you tried.
Getting stuck is perfectly normal and it happens to all of us no matter how long we have been in the industry. Whether you wrote your first "Hello World" or building a huge, complex application for a world-class company, there will be always a bug that blocks your progress.
Learning how to cope with this setback and find ways to overcome it will be key to grow as a developer. Give yourself at least 30 minutes to troubleshoot the problem by yourself. After the time has passed and still haven't figure out the problem, then it is time to look for help.
I hope you find this article beneficial and happy debugging!