DEV Community

Cover image for Why you should ♥️ Debugging?
Buzzpy 💡
Buzzpy 💡

Posted on • Updated on • Originally published at buzzpy.hashnode.dev

Why you should ♥️ Debugging?

Buzzpy

Hello again, buzzdies! Hope you had such a great week 😊

Alright, let’s get into the thing. By the time you read the title of the article, I’m sure you were like….

“What the hell are you talking about!?”

I understand because programmers or developers usually hate debugging, but what if we look at the other side of debugging? We always think that the time spent on debugging is such a waste of time, but that’s not true. Time spent on debugging is Golden!

Yup, that’s a weird sentence. But by the end of this article, I think you too will agree with me.

Debugging is the best way to learn

Buzzpy

Every programmer hates debugging, especially beginners. So did I at the beginning. I spent months learning to code, and when I started to build an application, I had to spend days just debugging the code. That’s not fair.

But later, I tried to understand the other side of it; if I’m finished with learning to code, why do I have bugs everywhere? That simply means I have a lot more to learn. Does that mean I have to go through another ton of courses?

That’s where I started to thank those buggy bugs in my code. When I have a lot of bugs to debug when writing code, I don’t have to spend years learning everything through courses or whatever, because when I find a solution to one bug, I have learned a bunch of important things.

There are many things I learned through debugging— Working with Threads and Async Functions, Different ways to import external scripts, running EXEs through different methods, and a lot more, which were never included in the courses I went through.

Debugging develops Soft Skills

Buzzpy

The second I face a bug, the first thing that comes to my mind is ‘Why is it always me!’. And when I spend hours trying to fix it and nothing works, I want to shut down this stupid thing and give up the whole project!

But when the time flies, fixing bugs for hours by focusing becomes a usual thing and we don’t feel the feeling we had as a beginner. In simple words, we can code like a monk. That means we have improved our patience and focusing skills, isn’t it?

Not only that, debugging helps to improve our communication skills as well. The best example is asking questions in StackOverflow. And since almost all of us have experience with that, I’m not gonna talk about it!

The main reason for improving our patience, communication, and focusing skills is Debugging. How can we hate it?

Tips for perfect debugging

Just in case you’re stuck with a lot of bugs and everything is messed up, these tips might be useful for you.

Ask Questions

Buzzpy

Before starting to fix bugs, you need to ask questions about your code. A rubber duck or a stuffed animal might be really useful. (But be sure not to ask those from a non-programmer)

  • What do you need the program to do?

  • What does it do?

  • What are the issues you’ve found?

  • Have you encountered these types of problems before?

  • If yes, What did you do to fix them?

  • Where and why do you think the bugs occurred?

I personally use this too often, and it gives me a good result in return.

Focus on Error Messages as well

![Buzzpy(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9zqpzfagpn966zeqgelv.png)

Error messages aren’t just annoying messages — they actually tell you exactly what the problem is with your code. So the next time an error message pops up, make sure to read it as it can give you at least a small hint about what’s going on. If you’re not sure what the error message means, try searching for it online. Chances are someone else has encountered the same problem in the past and could know how to fix it.

Log Everything

Buzzpy

This might seem like a boring thing to do, but it can save you a lot of time. Documenting every issue you encounter, as well as the steps you take to address them helps you to ensure that your program is running correctly. Once you’ve documented the error, you can start mapping out potential scenarios and solutions.

This will also allow you to navigate different potential solutions without repeating them.

Ask for help

Buzzpy
In a lot of instances, the bug you found is encountered by at least one more person on the internet. It’s a good practice to reach out to a community that is specific to the framework/technology/tool you are using.

For a lot of programmers, asking for help from the community is the first option. But I don’t agree with it because, in that manner, we get less opportunity to learn something on our own, even though the error gets fixed.

If nothing works, take a nap

Buzzpy

Believe it or not, this is one of the most worked solutions for me. There’s a psychological aspect to this as well. When you have debugged for hours and your head is messed up, a small nap, a walk or just a 30-minute break can refresh your brain. Who knows, maybe you have missed just parentheses or a semi-colon somewhere?

Conclusion

Debugging, hated by most developers has some beautiful sides as well. Understanding and looking at what is positive, can change everything, and even make you fall in love with debugging!


Enjoyed the article? Make sure to subscribe to "The Buzzletter" so you will never miss any of my content + any gifts I offer! 🐳

Image description(https://subscribepage.io/the-buzzletter)

Top comments (0)