If you're a developer, chances are you've spent countless hours debugging code. Debugging can be time-consuming, frustrating and fun at the same time.
In my career as a developer, I've encountered my fair share of bugs. From minor issues to major production outages, I've tackled them all.
Here are my learnings in 25 lessons that will help you elevate your debugging game.
Bugs are inevitable. You just get better at fixing them.
Train your mind to see debugging as an opportunity to learn.
Start with breaking down the problem. Obvious but overlooked.
Understand what happened before trying to fix the bug.
“But things are randomly failing” No, there’s always a reason. You just don’t know it yet.
Assume nothing. Bugs can come from ANYWHERE.
Investigate - When did the code work last? What has changed since then?
Never skip reading the error message.
Google it. Your issue is (most likely) faced by thousands everyday.
When debugging code, never try to prove yourself right.
Stop blaming JavaScript runtime. It’s your code that needs fixing.
Debugging is hard if you do it without a plan.
Explain your code out loud. Step by step. (Check Rubber-Duck-Debugging).
When things stop making sense, start thinking on paper.
Getting stuck is normal. It’s a signal to approach the problem differently.
Ultimate debugging hack is taking a walk.
Debugging tools are your best friend if you value your time.
Fixing a bug with a friend or colleague is criminally underrated.
Learn to ask for help on an issue. Give back by helping others.
Bug in production? Revert breaking change rather than pushing a fix.
Debugging a production system is an independent skill.
Document your learnings and share them with the community.
Debugging teaches you what you should know but don't.
To improve debugging skills — fix more bugs. Cliche for a reason.
That's it!
Hope you found these lessons helpful.
If you liked this post, follow me for more of these 🙂
Also, would love to hear your best debugging tip in comments 👇