Viewing Errors As Feedback When Learning To Code
Using “mistakes” and “bugs” to become a better developer
Before you freak out when you see that 404 Error on your screen, read this …
When I started to learn to code, I used to stress a lot when I see an error on my screen. I remember the times when my code did not compile, and I spent countless hours looking for what was wrong.
Then, finally fixing it, and just hoping that I would not encounter another bug in my code so I could finish it.
Does it sound like you, as well? No worries, you are not alone, I have felt the same way too.
As the years have gone by, my perspective has changed when I see an error come up on the screen. I some times my get stressed out, which is normal, I am human after all.
But, I have come to the terms that there is wisdom underlying these errors. So, I am going to share somethings I have learned through the years along my coding journey so that you can apply them too.
Errors Are Feedback
Along my coding journey, I have come to see errors are feedback.
That is, errors can pinpoint the weaknesses of your code or software application. Moreover, mistakes can be the catalysts of improvements that can be made to your code.
When these errors are fixed, your code will benefit from the time you took to fix it. Thus, improving your product which translates to bringing higher quality service to your users, that is if your code is part of an application that serves people.
What I have learned through the years is that errors can be transformed into a learning experience.
The first you can do when encountering an error is to ask yourself:
What could it be?
You may have an idea of what could be causing the error, thanks to previous experiences, if not, you can go ahead and search online, in platforms such as StackOverflow.
Going even deeper, the “bug” in your code can help you identify any concepts that you don’t fully understand in the programming language or framework that you are working with.
Hence, it’s an excellent opportunity to go back and review the ideas you are having trouble understanding.
But the most important thing I learned is to keep calm, breathe, and move forward.
Lesson #1: Errors can be used as motivation to make code better
I understand that you may have a deadline that you have to fulfill, but in my experience, letting your emotions take in control of you is not going to solve the problem.
So, what I realized that the best thing is to step back for a second, do something else and then go back in and take a look.
Something you can do is take a quick walk or drink a glass of water. These are suggestions, do whatever works best for you.
After you have distracted yourself for a bit, go ahead and take a look again at your code.
When going back, you may even see the error and was not as complicated as it had seemed at first glance.
No worries, this has happened to me as well. But trust me, it has helped me a lot.
Hence, I wanted to share it with you.
Keeping A Knowledge Base Can Be Useful
Another lesson I have learned thanks to seeing errors in my code, is to keep a knowledge base of the solutions that have come up during the process of solving these errors.
The idea of having a knowledge base of the solutions to previous errors is to keep a log of all the errors that have surfaced on your code.
You can look at the knowledge base and see if you have already solved the problem in the past.
The knowledge base doesn’t have to be a complicated thing; for example, you can create a folder on your internet browser and bookmark the solutions you have found online for your personal use.
Lesson #2: Having a source of the solutions to previous errors may help save time
You can go back to these solutions when needed.
Or you can create a document with the links to the solutions or your ideas, which you can send to other developers working on the same project if you wish.
This can help you save time, especially when you have encountered the same error a few times.
Having a knowledge base can even help you when you are working in a software development project, so if a part of the application is not working correctly, you can fix it and restore the application’s functionality.
Another benefit of having a knowledge base is that you can share it with others, that is, if you are working in a team environment.
By sharing the knowledge base with your team members, the team can save time and accomplish the team’s objectives faster.
Learning From These Errors Can Help, A LOT
Alongside changing the perspective of seeing bugs in my code, taking the time and learning from them has helped me a lot to grow as a software developer.
Furthermore, taking the time to sit down and reflect on the bugs in my code has helped me a lot to understand the inner workings of the system I am working on.
For instance, how the front-end connects with the back-end of the application and how I can prevent these errors in the future.
So, by solving these errors, the uptime of the application may increase.
Also, by investing the time and reflecting on the error, I could think and find ways to make my code more efficient.
On a personal level, if the error is something that you don’t master of the programming language or the framework you are working with, you can use this chance to look up resources such as online courses that help you learn these ideas. Thus, growing your skillset as a programmer.
Lesson #3: Taking the time to reflect and learn from the errors can help
Another realization of taking the time and learning from the error in my code is that I know now what to do to produce the failure in the code.
So, I don’t do it again in the future.
Moreover, when an error of the same kind appears, I have an idea of what to take a look at. Thus, saving time in the future.
Final Thoughts
There you have it, things I have learned through the years when working through errors in my code and coding projects.
The main lesson I have learned is that errors are feedback, and instead of overstressing about it, we can use them to improve our code and learn from this experience.
Hence, you become a better developer by learning from your mistakes and share the knowledge with others.
If you liked this article, I think you might be interested in these articles as well:
Credits and thank you to:
Disclaimer: Results may vary. These tips and advice are based on my experience and opinion as a former undergraduate Computer Science student, tutor, teacher, and software developer. Everyone is different, so, the advice shared in this article may or may not work for you.
Originally published at https://yadielcabrera.com.