Why failure in Coding is a good thing

One thing we try to instill strongly in our coding course is that it’s okay to fail. That, in fact, it’s a good thing. Failure builds character. And failure in the right, supportive environment is essential to learning how to deal with failure later in life. If you’re not used to failure and don’t learn how to overcome it in childhood, you could face situations as an adult that instead of motivating you to succeed, demoralize you.

Why is coding a good opportunity to practice dealing with failure? Because getting coding right is such a precise science and art form.

In coding apps, anything can go wrong.

If you’re at all interested in games or apps, as most of the smartphone carrying public is, you’ll notice even the best apps sometimes bug out. That’s because there are errors in the code that sometimes come into effect, resulting in a crash or other odd behavior. Why? Because coding is complex. And the more complex the app, the more complicated the coding for it is. We’re talking a minimum of a couple of hundred lines of code here. If even one little syntax is incorrect, it can sooner or later cause problems.

Getting the code right for an app when it’s released onto an app store is almost impossible. Which is why we often have so many updates with apps. These are fixes for problematic code or protection from exploits found by the general public and sent to the development for them to fix. What does this teach us? That writing even simple code can get complicated.

If your kid were to write their own code, for an app or a game, they’d have to be prepared for problems that’ll arise when they execute that code. Sometimes fixing problematic code means really having to comb through the lines of code, looking for the original mistake. Sometimes it’s about trying to find which lines of code conflict with each other. As they’ll likely fail a lot, due to the nature of the beast, they’ll need to develop a resilient attitude towards failure. But being resilient, they’ll cope better with real-world setbacks.

How to fix failure

In coding, the principle is called debugging. Debugging is the process of looking for bugs in the system. A bug, of course, is a rogue line of code that is causing the hiccup in the game or app. Here’s an example: there’s a game where you run around an entire 16 square mile city. You get to interact with citizens, go on missions for in-game money, and even drive around in vehicles. So, for instance, when the player’s character walks through walls or can’t get out of a car, you have a bug. Then the development team somehow (either through their own player testing or through reports from gamers) learns of this particular issue, their job is to hunt the bug.

(Incidentally, as we’ve mentioned in previous posts, the term “bug” initially came from when computers were the size of rooms with components that were huge, and insects could easily find their way into. As was the case sometimes when the computer didn’t behave as expected, someone would have to go into the computer itself to remove the “bug”.)

When you’re talking about the millions of lines of code for such a complex game, this isn’t the easiest task, and what’s worse, sometimes fixing a line of code can affect another line of code, causing a different problem. This happens all the time. So, when your kid is to write the code for a simple program, and it doesn’t go as predicted what they can expect is a bug hunt. And it isn’t the easiest thing to do alone.

Part of our personal code is that of assistance

In our particular synchronous online courses for coding, it is encouraged that students help each other. That they form some sort of bond, so they feel comfortable asking for help. When they hit a snag and they can’t solve it on their own — such as a line of code they’re not writing 100% correctly — help is available. Because we’re a synchronous online school, the kids will be able to communicate with each other. In fact, the sense of community among our students is considerable. What one student can’t see is the problem, the fresh eyes of a different student can.

Just as in real life, due to the number of things that can go wrong in coding, we all need a helping hand from time to time. IRL (in real life, that’s the abbreviation in online chat lingo), not asking for help can either keep you stuck or make the situation worse.

Learning it’s not a weakness, but a strength, to ask for help is what gives students emotional maturity. After all, we’re a species that has evolved to collaborate, as we discussed in our blog here. Not collaborating because of unhelpful qualities like ego or an inability to ask for help are not great qualities for a child to take with them into adulthood. Failure at coding can sometimes mean you need to be successful at reaching out. And, of course, helping others, in turn, develops an altruistic sense of community.

Problem-solving is another reason failure is a good thing

Sometimes you need to be good at deduction to find where the troublesome line of code is. But what’s equally important is figuring out why it’s causing problems. A bit of bad code can influence areas that don’t seem related to it. This makes it harder to find. And to find out why. Solving the issue requires the use of both your lateral thinking and linear thinking. We call lateral thinking “thinking sideways”, i.e., thinking in a way that you make connections between different things that don’t seem immediately obvious.

Yet, it’s essential in problem-solving. Thinking linearly isn’t enough. Linear thinking is the step-by-step approach. Like when you phone IT for help because your computer isn’t on and the first thing they ask you to do is check that it’s plugged in (surprisingly often, this turns out to be the solution). But with coding issues, where the app is just not responding as it should be, the step-by-step approach, while important, doesn’t always solve the issue.

Lateral thinking is the so-called “thinking outside the box”. It’s where you try to use your imagination and creativity to create associations related to the problem and what could be causing it. This activates lesser-used parts of the brain (because we, thanks to the traditional schooling system, have been mainly taught to think linearly at the expense of laterally).

Sometimes, the answer strikes like lightning as a eureka! moment. When that happens, and the right line of code is fixed, leading to the problem going away, the student feels an immense sense of victory. Normally, following this, there’s the sense of “obviousness” that comes with it. Like, how it should have been apparent what was causing the issue. But it wasn’t apparent, it’s only through making the right connections in the brain initially that the answer becomes visible.

Problem-solving is excellent for the brain, which is probably why many people play crosswords in newspapers.

It’s time they succeed in failure.

Our school is designed to help children succeed even when they fail. That’s because through our synchronous learning, teacher guidance, and teaching platform designed for classmate interaction, kids can have the free space to experiment, fail, try again, develop resilience, ask for help, problem solve, and eventually succeed. Which in turn not only teaches them the hard skills of the subject at hand but the soft skills necessary to succeed in life. Enroll them in one of our courses today.

 

Responses

Comment below