Vishwas Acharya
Vishwas Acharya

Vishwas Acharya

5 Debugging Tips

5 Debugging Tips

Vishwas Acharya's photo
Vishwas Acharya
·Jul 2, 2022·

3 min read

Subscribe to my newsletter and never miss my upcoming articles

Table of contents

  • TIPS

Hey! How's it going, assuming everything's fine. So debugging is a very important part if you are a software engineer but apart from that it is also important in life as well.

Helps you understand things clearly

So I was going through some YouTube videos while learning JavaScript and saw this amazing section of a webinar video that explains this debugging tips, And so I wrote those points so that I can remember them. And that is the reason why I wrote this blog so that If you don't know this tips then this blog might help you as well.

TIPS

So let's dive straight into it.

  1. Don’t Trash your CODE!
  2. Read the error Message!
  3. Don’t Waste time on the impossible! (or at least the improbable)
  4. When in doubt, print more out
  5. Take it one step at a time, and print it out

This points are pretty self explanatory, but still I'll share my explanation as well, Read further to understand in detail.

Don't Trash your CODE!

  • I used to do this every time I ran into some error or bug, CTRL+A -> DEL baam just trashed it and started from scratch.
  • But eventually It was consuming a lot of time and efforts which was not supposed to be needed in those kind of bugs/error.
  • So clearly this was not an effective approach for better understanding as well as to become a better software engineer.
  • Instead if we just try to figure out what exactly go wrong, or try commenting out some of complex code blocks, which also leads to our next point.

Read the error Message!

  • Read whatever the error message out loud multiple times, so that is get's clear in your head.
  • I know that error messages are so long and really nerve wracking but still if we make a little effort of reading it out, we might get the solution in the error message itself, which technically most of the time we'll get our solutions from error itself.
  • But what's not cool is that reading the error message in a hurry and wasting your time and effort in searching the wrong place because you misinterpreted the error.

Don’t Waste time on the impossible! (or at least the improbable)

  • If you take too much of time spending on fixing a bug/error which takes too lot of effort and time then just shut down your computer/laptop and go for a nice walk or listen to a song or do anything except stressing out your mind.
  • And then come back and try to solve it, most of the problems gets solved in just a minute or so.
  • If you still didn't solved it then try reaching out to your senior/stack overflow/google.

When in doubt, print more out

  • Simple, As it says when you are in doubt, print out more, because if you don't even know what's happening behind the scenes then how to do expect to solve any of your errors.
  • You might get an empty array printed out which you were using before to get the values inside the array.

Take it one step at a time, and print it out

  • And last but not the least, Go slow, Doesn't matter what is the speed of other developers compared to you. They might be fast but if you copy them then instead of cutting time you'll extend your time and effort X2.
  • Hence, like I said in the last point print more out, It'll easily solve your problems.

Being a software engineer your work is to make things easier not to make things complicated.


By VISHWAS ACHARYA 😉

#BlogsWithCC

Did you find this article valuable?

Support Vishwas Acharya by becoming a sponsor. Any amount is appreciated!

See recent sponsors Learn more about Hashnode Sponsors
 
Share this