Scripting

10 Debugging Skills For Programmers

Enhance Your debugging skills

Errors or bugs are an integral part of a programmer’s daily activity. To an experienced programmer, bugs are normal, but to a newbie, bugs are scary, discouraging and
should never be seen in a code. As part of my #100DaysOfCode journey I worked on debugging skills. These 10 steps can help debug our code.

? Describe the problem.

When you find a bug, it is important you go back to the problem your
code is meant to solve, then describe it as you go through your code, you might find the line of code that has the bug.

? Reproduce The Bug

Sometimes when you run a code once twice or thrice it successfully runs and produces the right output. but running again gives an error, this time it is important to check the range of iterations you want to make and see if your iterable meets the conditions. So running your code over and again helps find out where such might occur.

? Print Is Your Friend

Yes, you saw it right, Print is your friend. It has proven severally to be a problem-solving tool for me. When my code doesn’t produce the output expected, I use the print function to print out all my variables. This helps catch errors that your console and IDE couldn’t catch.

? Use Debugger Tool

Using a debugger tool online or on the IDE help to visually go through your code line by line and understand how your code is run. This is also a very potent tool.

? Take a Break

I couldn’t agree less with Angela Yu. Giving myself a break from the code has helped me severally to debug codes. The good thing for us using python is that it has cleaner syntax than other programming languages. Take a break, distract yourself with other things, or even take a good sleep and shower. Then come back to it. You will be amazed at the magic.

? Ask a Friend

This is a very potent and time-saving method of debugging code. But this can easily make us lazy. Asking a friend or colleague gives you the opportunity to get someone to see things with a fresh eye. It doesn’t make you less of yourself. Anyone who could but refuses to assist you is unprofessional. I will suggest that we don’t use this method all the time.

? Run Your Code Often

It is important that will run our codes often as we write them. This helps us catch the bug earlier. When compared to running your code when you are completely done, you will likely have more bugs to deal with.

? Ask The Oracle in the house GOOGLE/STACKOVERFLOW

This is every developer’s go-to place for problems we have. It doesn’t matter the level of experience you have. We all use it. It is actually a vital skill to have if you must succeed in this industry. So, get comfortable with using it.

Conclusion: We have seen some of the ways we can follow to debug our code. Debugging skill is not a skill you want to avoid having. As a programmer, bugs are an integral part of a your daily activity. You need to understand that your experience grows as you solve more problems. This list is by no means exhaustible, but they are good starting points. Feel free to add to the list using the comment box. I will update it. Your get some simple examples in my Github repository

Kingsley Ihemere

I am a detailed and self-motivated Business Intelligence Analyst with diverse experience in Database, ETL and analytical tools and web frameworks. I excel at team leadership, modern BI technologies, data analytics and technical writing. I am offering over 5years of experience in improving business operations through data and software development. Have you got data to explore? Let's talk about it. Send me an email via kingsley@dekings.dev

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button