BUGS (and how to fix them!)
An unavoidable part of learning to code is running into bugs, but learning how to fix them is a great way to develop a deeper understanding of your code! Read on to find out our tips and tricks for fixing bugs...
If you’ve ever tried coding before you’ve probably come across the dreaded “Bug.” A problem in your code making it either not work, or work in an unintended way. Now I don’t know about you but sometimes these can be a little tricky to find or fix. Luckily I have some tips for us all to help!
-
The Rubber Duck Method
I always find talking through my problems is a really helpful way of understanding and sometimes fixing them. Programmers throughout the years have thought the same! Unfortunately (unless you’re in one of our sessions) it’s often difficult to talk to someone about them. This is where the rubber duck comes in. Explaining to the duck how your code should work does something in our brains to help with understanding! Also who can be mad at a silly little duck?
-
Adding Logs
I’m not talking about setting your code on fire (believe me, I’ve tried, it doesn’t work) I mean adding small bits of code that provide an output to tell you whether a piece of code is working correctly or not! Think about having your scratch sprite say “I did It! After a complex bit of code so you know it works, if they don’t say anything, you know that they failed somewhere along the line.
-
Check for typos
I’ve done it, you’ve done it. Writing the word “tree” as “tre”. So reading through your code, while being a tedious process, is a super useful tool we can use to improve our knowledge of the code, and any potential mistakes we make!
-
Ask your mentor!
If you happen to be one of the amazing members of The Code Zone, you have access to our team of STEM certified mentors! Your mentor has plenty of knowledge that can help either diagnose or help fix any pesky bugs that pop up, either through the text chat, or during our live sessions!
Hopefully some of these help you in your coding journey, or maybe you have your own that you’d like to share with us? We’d love to hear from you if that is the case!




