Fixing bug Day 02 of #30daysofweb3

·

2 min read

Introduction

So basically I just had issues with the NFT smart contract today, had to fix it a lot of times. So I want to list out few of the things that helped me with the bug fixing. The cause of my bug was later due to a misplaced ";"

Guidelines to fix your next bug

1. Read the error message

What took most of my time was that I didn't try to understand the error message printed,

  • check for the line throwing an error
  • read the whole error message they mostly contain the reason and also the solution.

2. Make Google your friend

The Google was created to be a search engine to provide answers to your questions, all what you need to do is copy your error message and paste it in the search tag and it will pull all the articles that are related to your errors.

3. Know how to test your code so as to know where the problem is at

For JavaScript a simple console.log() can save you a lot of headache, placing them in each function declaration to check if a function perform what you want it to do.

4. Ask other professionals

Always ask from people that you know that are professionals in the space. They might have encountered a problem like that and if not you will be connected to someone that can get you the solution.

5. Join support group

The best way to learn is through the community learning because this will push you to higher heights. So basically support group comprises of people that are studying what you are working on. And most of the time you find pros in the group who can solve your problem.

6. Sleep

Sometimes you just need rest, walk away from your pc, desktop or whatever you are using take a break because most times the fault can be from you.

That's all for how to fix your bug