The Psychology of Debugging your code like a Pro
Tags: webdev, javascript, testing, programming
Published: 2023-02-22 22:13:35

**BUGS!**,_what are they really?_

In a word - Errors.

  They are the unexpected defect that happen suddenly to program, which are capable of causing problem or issue in a code.

But the methods you engage in Identifying, Finding the exact point where the root problem is, (maybe a programming mistake), Fixing and Preventing such behavior subsequently is called "Debugging".

Trust me,this is not the usual article on every page and blog about _debugging your code_, you might have come about on the internet because there are a thousand  one article already as well videos to complement them.

But something is missing in the context of those information, which is  focusing more on how to solve the current bug rather than the Psychology towards debugging.
 Is it wrong no!, Definitely not but it is not solving the bug within the software developer.

![confused engineer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdqv4zozpmtvq9lga9vj.jpg)
[](https://www.freepik.com/premium-photo/confused-tech-engineer-sitting-doubtful-computer-trying-solve-network-processing-errors-computer-programmer-puzzled-by-nonfunctional-security-algorithm-company-corrupted-database_25474068.htm)

## Bugs Are Evil.

  Before diving deeper,every software developer must understand that bugs(technical errors) are not evil or bad,like it had been painted to be by most software engineer and this has affected many newbies and some experience developers are as well still trapped in the consciousness of it.

So quickly, if you're in that category kindly take it off you mind because,it is the first limitation in discovering the beauty in debugging.
Yeah, it always remind you that _"you can make mistake, irrespective of your years of experience; keeping you humble"._


!["Love what you do,to do great work"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9l4athy1cvwtth48x1j.jpeg)
[](https://www.google.com/search?q=love+your+job+quotes&oq=love+your+job+&aqs=chrome.0.0j69i57j0l3.11281j0j4&client=ms-android-transsion-itel-rev1&sourceid=chrome-mobile&ie=UTF-8#imgrc=sFEKaCVjbz7xZM)
## Doing Great Job
  
   The moment you begin to love what you do, then you begin to do great things is also true when you are debugging an entire codebase.

You as a Software developer must see bugs and debugging it, as normal activity and as something that is prone to happen in the development process to really enjoy what you do.
This is basically the psychology to debugging your code like a Pro because until you understand this concept you won't do great work since you don't find it enjoyable.


![Let's get started](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/es67jkjuf47rwu7esoox.jpg)

## Debugging Process

Setting out eventually,you need to be skilled irrespective of the programming language you want to debug, else you may end up building back the mindset that debugging your code is difficult.

Firsty, you need to **Identify** there is a bug; becoming aware that there is a bug in your program and this usually happen during:

- Development

- Through Automated testing software.

- Users reporting error feedback during production.

Then we **Find Out** where the bug is located,where exactly the bug is happening in the code and for this you might use the developer console (if it is a simple code) but if you are dealing with a large codebase, you might need a debugger.

**Fixing** this errors will be the next thing to do,where by you correct the bug by replacing wrong solution with newer solution that actually works.
And it does not stop there,trust me.
There might be also similar bug like that aside from the Identified bug let's say in a Function block for example, so what you do is **Prevention** against such in the future from happening, this can be done by searching through but a more advance way to do it is writing Test using testing software, which I will be writing about in another article because it is an important part of software development.

So that's it!

IDENTIFY - FIND - FIX - PREVENT.

> _But,this can't be carried out successful without Patience._