How am I dealing with my ever-improving Debugging Techniques

Co-Founder, @CreoWis | Teacher, @tapaScript | Founder, @ReactPlay | YouTuber | Writer | Human
Search for a command to run...

Co-Founder, @CreoWis | Teacher, @tapaScript | Founder, @ReactPlay | YouTuber | Writer | Human
Being a detective and same time a murderer. Good read Tapas Adhikary
More than a decade now into the programming world and still rely on StackOverflow and google search more often when we don't find the result to solve the crime created ;-) Is there a repository you have in place for such crimes? Where it is being debugged and solved and closed for good? [ Aaah! my question was not to re-invent StackOverflow Q&A's or create js-perf samples. Was keen to understand your ways for solving the crime ;-) ]
Haha!! Thanks Santosh Giridhara for looking into this and commenting!
All my crimes are very much here:
https://github.com/atapas
...and it continues :)
Traditional SSR is great, but it has a massive buffering problem. Let's look into the SSR Streaming and learn how it could be a game changer.

Learn how to build maintainable, reusable forms in React using design patterns like custom hooks, compound components, and context for scalable CRUD

Learn how JavaScript variables work, including let vs const, primitive and reference types, pass by value, and how JavaScript stores data in memory.

A beginner-friendly introduction to JavaScript covering what it is, how it works, and how to set up your JavaScript environment

Learn how the promises are handled internally using event loop. This concept is essentials to debug and work with async programming.

GreenRoots Blog - A Blog by Tapas Adhikary
186 posts
Educator | YouTuber | Building ReactPlay | Let's Connect
How much time do you spend in debugging? Well, I know that the question is bit vague and the answer would vary. After spending close to 15 years in Computer Programming, I still can't say confidently how much time I really spend in debugging things. There could be multiple factors that influence it and make it uncertain to answer:
While there are many other factors to consider to time-box your debugging for finding fix, there is one very important consideration to make. Debugging is a Skill and it can be improved.

Yes, right. We, the developers are the primary bug creators and it is perfectly fine to be like that. With that, we are also responsible to 'debug' the code to make it bugs free(as much as possible!).
In rest of the article, I will be explaining what I have been doing to improve my Debugging Techniques. You might see something in common.
Fix for a bug in one component may have the potential to break something else in other components. Hence having a clear idea on the big picture helps great way.
Understanding of how the different components talk to each other, dependencies, data exchange etc are key factors to understand before attempting a bug fix. A good debugging technique is to take these into account and proceed.
When we talk about improving the debugging skill, it would be a much better polish if we debug a code not written by us. Believe me, it is a pain but at the same time, teaches many lessons.
Let's take these two cases:
I have experienced that, discussing the approach with a peer helps accelerating lots better. Often we get a different ways to look into things. Your peer would have solved similar issues already.
Even when you have got the right techniques and skill to debug issues, the lack of right tool to assist may slow down your progress. To give an example, instead of putting console log at the suspicious point, it is better to use a visual debugger tool, if available.
Point to note, availability of a a great tool is also not enough if the right Tricks and ways are not clearly known to use it. An example could be this one .
Many a time debugging is deep. It needs time, energy, patience and attitude. There will be time where one will feel helpless, like reaching end of the tunnel. This is the time to come back, see things from the beginning. Don't give up. Compare steps between different approaches, try finding the gaps.
It is a good practice to enable appropriate logs while debugging. Additional logs from various components and modules helps tracking things. At the same time, you got to make sure, appropriate logs are there in the code. If not, please add and improve.
Take a good note of your debugging steps. This will help you in triaging issues in similar areas in future.
Tired of debugging and not reaching anywhere? Take a good Cofee Break. Breaks increase productivity and creativity. They say, “Aha moments” came more often to those who took breaks!
To conclude, these are my learnings and experiences to improve the debugging skill. I am certain, there will be many more different and effective ways. Feel free to comment what you have found effective for you and your team.
I would like to finish this article by mentioning a great read by David J. Agans called, Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems. Read at leisure.
Here is a great poster from the website of the author:

The cover image of this post uses Icons made by Freepik from www.flaticon.com
Hope you enjoyed reading this article, See you next time.