7 Bug Handling And Problem-solving Tips For Developers.

7 Bug Handling And Problem-solving Tips For Developers.

My bug story.

Alright, this bug seems to be so stubborn, it just won’t get fixed!!!

That was my story while working on a project just the day before yesterday. I was building a simple website for a holiday program in which I served as a tutor in the tech category. I had promised to build a website about the event. The website was to have a blog where I would add stories of some participants and that of the program principal.

I had introduced the participants to programming and some necessary coding basics. I taught them HTML and CSS using a hands-on approach by building while explaining and teaching. And as a way of supporting what we achieved in the coding session, I decided to build this simple website.

Since it was a simple website, and because I only covered HTML and CSS most, I decided to make the website very simple by not using my regular tech base (ReactJS or NextJS). So I decided to build the website with just plain HTML but with tailwind CSS. This will be my first time using Tailwind CSS on a plain HTML project, I’ve been using tailwind CSS for some time now but not on any plain HTML project. I’ve only used Bootstrap, SCSS, and vanilla CSS on my plain HTML projects.

I decided to use tailwind CSS because I was currently building a blog/organizational website which I had earlier paused. I was building the project on NextJS with tailwind CSS for styling, and contentful CSM for the backend(data management). Since I was already done with most of the UI aspect which included the blog and other sections, I thought that it would be just very much better if I used tailwind CSS on this other simpler project too. That way, I could easily copy and paste the sections that I wanted into it, Then I would adjust all the JSX patterns into regular HTML patterns. (Please note here, that the project was not a client project. I had ownership access to the project, and hence was permitted to do any copying from it if I wanted).

I set out with repo setup, tailwind installation, and other project setups. Although I encountered some issues with getting tailwind to work seamlessly, those issues weren’t as buggy as the silly one that got me writing this story. I kept on with the development progress, and was ready after some hours to make my first live production deployment.

Netlify was there to help for free of course, hence getting the site hosted with a free subdomain was as easy as maybe less than 5 minutes. I finally got the site deployed via Github, but the site still had some issues that i wanted to fix up. I tried and tried to get some parts of the UI fixed up as I wanted but it wasn’t working. I even had to shut down my PC at least twice thinking maybe tailwind’s transpiler was having some hitches with it.

Too bad, Mr bug still would’nt fix up despite all I had done.

It was just as evil as many bug experiences could be.

Like, "This and this are all set up, why on earth is this refusing to work".

Finally, I got lucky enough to finally spot the issue while inspecting some of the code.

My bug was caused by my failure to change some instances of JSX “className” to “class” which caused tailwind not to recorgnize the classes being applied to those parts of the UI.

Pheeew!!!

That was my bug story which happened just yesterday. Luckily, I was able to get it fixed without wasting so much of my precious life.

Here is a link to the website if you care to check it out – https://dlesfh2022.netlify.app

Every developer has one bug story or the other to tell. This confirms the fact that developers and bugs will always keep clashing. software-testing-5722928_1920.jpg

The big problem comes when we are unable to resolve those bugs and solve the different problems confronting us as we engage in the different development processes and stages.

Learning to fix bugs and handle problems, are special arts that every developer/software engineer must master.

While some might argue that bug handling and problem-solving cannot be mastered, I beg to differ somehow. I know that bugs can be very unpredictable and evil-seeming sometimes. Hence I agree with the fact that no developer can truly ever become a bug “detection lord”.

Despite this, I still believe bug handling and solving development problems can become less difficult and demanding if developers get to master some systems/techniques that can help make the process to be less of a pain. Just below, I have compiled 7 tips that I have learned. These tips when mastered will certainly help you get more comfortable whenever you get stuck with bugs or any other problem.

Some of the tips are already methods that I practice actively, while the others, I hope to get used to them from now onwards.

Before I continue with listing the tips, The biggest takeaway any developer should get from this article is the fact that

“handling bugs and solving problems starts with knowing and having the right mindset, attitude and approach”.

Don’t treat bugs and problems like they are spells coming from an ancient evil temple somewhere in Jupiter, Mercury, or some other planet. Instead, Stay calm and take them out with confidence whenever they show up.

Below are seven tips to help you do just that.

7 Bug Handling And Problem-solving Tips For Developers.

Tip 1: Get some rest!!!

Yes, just rest!

As simple as it may seem, a good number of bugs that developers face, end up being overrated and blown up because we choose to continue battling to get the problems resolved even when we are tired, worn out, and need rest. Even when you feel you do not need any rest probably because you just started your day, It is still a very wise choice to take a break and get your head cleared up if you know you’ve worked for a while and still can’t fix an issue.

You might have noticed that most of the awesome solutions/stunning algorithms that you’ve ever came up with, didn’t show up when you were rushy and hasty in the chase to “find and kill a bug”. They came when you were calm, and thinking more gently about that problem.

So when next you get stuck on a bug, or when next you confront a problem, wisely remember that one of the most potent bug detention and killing tool is “a clear and refreshed mind”.

Choose to not be as hasty as you’ve been before. Simply learn the art of deciding to take a break instead.

Just take a break and “get some rest”

Tip 2: Googling as a skill (gaas)

This for me will be the number 1 resort whenever I face development problems or encounter bugs. It’s just so comforting to be aware of the fact that almost all the problems or bugs that you are currently facing, have been encountered by someone else. Isn’t it just so amazing how often one of the top links that a google search result returns turns out to be a stack overflow thread containing life-saving solutions to bugs we face? It’s just so mind-blowing how stack-overflow has grown to be very full of solutions to developer problems and bug fixes over the years.

Getting comfortable and used to frequent google searching, is a must-have skill for every developer. Some people even advocate that there are special google search skills to master.

For me, the ability to find answers with much ease through a google search came very much naturally. I am not in any way against such advocacy, go ahead and search out those special skills and learn them if you have to.

But one thing I want every developer(especially newbies) to get a hold of, is the fact that you shouldn’t get intimidated about learning any special googling skills when it might just turn out to be a very much natural thing for you like it has been for me.

So when next you encounter any bugs or face problems, simply comfort yourself with the hope that the solution to your problem could just be a simple google search away.

Just remember that the first/top few links on the result page of a google search will most times contain the answer to the problem you are currently facing.

Tip 3: Ask for Help.

sunset-1807524_1920.jpg

Yes, the third point on my list is “asking for help”. It’s as simple as those three words.

"ask someone for help".

It could be a colleague(Junior or Senior), or even in a superb online community like WhatsApp groups, slack channels, or on discord. Just ensure to add asking for help to your arsenal of options whenever you get stuck with a bug or a problem.

Always ask early enough. You don't have to get torn and worn out by a bug before asking for a help that took only 5 minutes to get your bug fixed.

To add to this, I must mention that developers are “busy” folks. Everyone has got their own project to work on. Some might even be facing problems and bugs like you, As a result of this, I strongly advise that you do not feel offended whenever it seems nobody is giving an answer to the question you just posted.

I also recommend that you get used to asking privately. Request to chat through direct messages and get used to running to individuals for help instead of general postings in community spaces. Either method you choose can work though.

Also, whenever you run to someone or to a community for help, learn to be satisfied with as little information as possible. Don’t expect to always be spoon-fed with every bit of information you’ll need. Because the fellow that’s helping out might not have all the time to explain in so much detail. You might just get some relevant links or resources to help you out. Hence It is important to humbly say thank you and walk away to finish up the remaining work yourself.

While I mentioned asking for help, I must also emphasize that developers(especially newbies) must learn to solve problems on their own. You should first get some rest, try out some google searches, and checkout stack-overflow, youtube,or any other platform that offers help, before running to ask persons or groups for help.

Don’t become so pesty and “a pain” to people because you failed to learn for yourself how to solve problems and keep showing up to ask for help.

Make conscious efforts toward building your own problem-solving skills.

Tip 4: Be willing and have an open mind to “learn from your bugs or problems”.

“Bugs aren’t always evil after all”

The above quote is a simple truth that I am currently coming to strongly agree with. I can now see that although bugs can be very difficult and “evil seeming” sometimes, they still have some very good sides.

Bugs teach us a lot of lessons. We become better after detecting and handling them, we get equipped with a good deal of knowledge to go past them easily when they show up next time. Another benefit is the fact that they add “feathers of honor to our caps” whenever we use the knowledge we have acquired from solving them to help others.

So when next you encounter bugs or problems, simply give yourself a gentle tap and build up the right mindset to calmly face and learn from them.

Tip 5: Own up to your bugs and problems.

As I mentioned earlier,

“handling bugs and solving problems starts with knowing and having the right mindset, attitude and approach”.

Treating bugs with hate is actually not one of such “right mindsets or attitudes”.

You should always realize that most times(if not always), your bugs/problems were caused by you!!!

So instead of rushing through and cursing them while trying to handle and solve them, why not own up and accept the fact that it was actually you who made a mistake and got it wrong somewhere.

I believe this mindset of owning up, will greatly help you approach those bugs with more gentleness and calmness. Which will in turn enable you to tackle them with more control, stability, and focus.

If you practice this often, I bet you’ll find yourself resolving bugs and solving problems more easily. Because you will get used to gently and calmly looking through your codebase in search of “your mistakes” and not in search of “those evil and cruel bugs”.

Tip 6: Refactor – accept instructions and follow the proper route.

Sometimes, our bugs persist because we choose not to obey simple instructions. A simple but practical instance of this could be because we insisted on doing things our own way instead of following “what’s on the docs”, or the general convention.

Simply “avoid following shortcuts”

At times, our bugs take so much needless extra time to fix because we stubbornly refused to do something the proper way. By failing to do the right things, and trying to follow self-inclined or simpler routes that are illegal, we sometimes end up wasting precious time and over-rating our bugs because the method we chose, ended up failing us. So why don’t you just follow the right path instead – even though it might take longer.

You might just end up returning to follow that “correct path” after wasting precious time trying to do it your own way.

Tip 7: Transfer to someone else.

Yes, that’s it. The last bug handling and problem-solving tip on my list is to “transfer to someone else”. It might just blow your mind, how a colleague gets to effortlessly detect your bug within only a few minutes after you allowed him take your seat.

We see things differently a lot. Aside from this fact, it’s simply true that someone might just be willing to look directly into your code to help you out instead of sharing screens or making long calls and videos to show you how to fix a problem.

So when next you’re facing a stubborn bug, an option on your list should simply be to transfer to someone else”.

Conclusion

I’ll like to start wrapping up this article with two simple points that I made earlier.

  1. Bugs aren’t always evil after all
  2. “handling bugs and solving problems starts with knowing and having the right mindset, attitude and approach”

So learn to handle bugs and dev issues with the right mindset, attitude, and approach.

Wow!!! over 2000 words. If you’ve read this far, I salute your passion and interest in becoming a better developer/software engineer with regards to handling bugs and solving problems. I also appreciate you for taking out time to read my article.

I just hope this article has given you much value.

This article is part of my participation in the Hashnode #4articles4weeks contest. It is my second article for #week2. It is also part of my intentional efforts to grow my blog and become better at technical writing.

I’ll be thrilled to see your reaction(s) and comments. I'll also appreciate it if you follow me on social media. See links below.

Twitter and Linkedin

My Next Article

Keep on the lookout for my next article, It will be my third in this contest. I promise that it will be a big blast. I am currently building something super awesome which I’ll be showcasing next week. I bet your mind will be blown.

Cheers!!!

#problem-solving #bug-fixing #developer-advice #4articles4weeks #week2