Daniel Byron

5 Things You Should Do If You're Learning to Code

I previously worked as a coding teacher for kids and teens, and taught hundreds of students how to code. Among those students, there were a few very high achievers. These students consistently won challenges, publicly released their own apps and games, and performed well above their peers. The thing that made these students different didn’t seem to come down to any innate ability, instead they did a few things differently that I believe all students (children and adults alike) could learn from.

1. Ask follow up questions

These students were constantly asking “why”. It wasn’t enough for them to learn the syntax without understanding why it is the way it is. Some of the time the answer was a rather disappointing “that’s how the language was designed”, but many times it led to an interesting discussion about coding conventions or even how the languages worked under the hood.

Their curiosity didn’t stop at syntax either, they would ask what the computer was really doing whenever they wrote code. They would frequently come up with different ways to achieve the same result, and then ask why you should or shouldn’t use one over the other.

However, one question I didn’t get very often was “why is this useful”. I believe the reason for this is because of another thing these students did differently…

2. Have a project to apply your knowledge towards

These high achievers didn’t need to be told “here is why a for loop is useful”, they could immediately see the value in it because they all had their own personal projects that could benefit from using a loop, or a class, or whatever concept they were learning.

They often had already done something the hard way, in a project that they were excited about, which made it all the more exciting to learn about concepts that would enable them to do it better in future.

I had one student who was so eager to make a game with many moving characters, that they’d copy-pasted hundreds of variables (‘enemy1XPos’, ‘enemy1YPos’, ‘enemy2XPos’….). When we introduced the concepts of classes and lists, they didn’t see them as abstract ideas but instead a very real solution to their problem of having hundreds of copy-pasted lines of code doing the same thing for each enemy. This new knowledge enabled them to create any number of enemies just by changing one value in their code.

3. Experiment and break things

I’d often encourage students to try changing a few values to see the effect it has, or get them to purposefully write code that will cause their program to crash so that they’d recognise the error and be able to fix it if they made that mistake in their code again.

Some students were too afraid to purposefully “ruin” their code, which to me was always a sign that they didn’t understand their code well enough to begin with. They’d just blindly rearranged and copied things until it worked, and then didn’t touch it again. These students would struggle later with errors and crashes with no idea what they were doing wrong, when the students who had run into those errors before knew exactly what the cause was.

The students who would write their code once and then move on also had a much harder time using the concepts later when compared to the students who spent a little time after each exercise experimenting with their code.

4. Show your work

Each week, some of my students would get to class early to show me something they’d been working on over the week. They’d demonstrate their project and I’d offer them feedback and suggestions. They’d leave with a lot of new ideas for their project, and would then excitedly bring the project back next week with all their improvements made. This helped keep them motivated on their projects, as well as learning a lot by having somebody else review their code.

Even if you’re self-taught, you can still put your projects out there on sites like Github and share them online (might I suggest https://www.reddit.com/r/coolgithubprojects ). If your project appeals to others you might even get people contributing to your project, get feedback and learn how to collaborate with others. It’s also great to learn about things like version control, and having an active Github account with your projects will help you down the road when looking for developer jobs.

5. Keep Going!

One of the best aspects of my job was watching these students develop their skills over time. And it does take time. But these students would come back each week, and it was great to see their hard work and effort pay off when these students won coding competitions and were able to realise their dreams of making their own games and apps for themselves.

Anyone can learn to code. That doesn’t mean everyone should, or that everyone wants to, but you don’t need to have a special gift or knack for it in order to learn. It won’t happen overnight, it might not even happen in a year, but if you stick with it you will improve.