Bugs occur when your code does not give you the expected output. In some cases, the code won't even run. Several things can cause bugs, e.g typo error, syntax error, compatibility issues, external APIs etc.
Here is my recommended tips on fixing bugs in order of appearance.
Read your error messages. Take your time to read and understand the error messages in the compiler. Review your code and console log strategic blocks or units to confirm their outputs. If you don't understand your error messages, Google them.
One of my mentor Damilola Babalola will always remind me that codes aren't magic. "It is not. magic, it is code" lol.
If you do this correctly, you will be able to know exactly where the problem is coming from meaning your problem is 50% solved.Check Official Docs. Spend time on official documentation. For some reasons which I am yet to understand, most developers don't like spending time on official docs. Myself inclusive until recently. But trust me, official documentation is the best place to go when you are stuck.
Call a mentor, colleague or friend that is very familiar with the technology stack that you are working on. This works like magic. If the person is well experienced, he or she will tell you exactly what do even before you are done explaining the bug. But remember No 1. Understand your bug first, don't go a waste somebody's time.
Stack Overflow: No need to elaborate on this one. lol
Read blog articles: Blog articles can be very insightful.
Check relevant projects on GitHub and see how others approached similar challenges.
In all of these, I consider number one the most important. I once spend over two weeks on a bug during my beginner days, this was simply a file path issue, and it was clearly stated in the compiler The system cannot find the path specified
.
Feel free to share your thoughts.
Check out my portfolio site to connect with me http://ushahembashir.com/