Learning to code is easy, until it’s not.
When you first start learning how to code, you are learning the syntax and some of the basic operations. This all seems fairly straight forward, and you start to a gain a bit of confidence in your abilities. The problem usually occurs when you try and apply that knowledge and try and build out your own project.
The hard part about learning how to code isn’t actually writing code.
It is working out how to solve problems.
To overcome this, people tend to go in search of tutorials that will tell them how to build exactly what they want to build. This could be to build a website, an API or a maybe even a game.
If they are lucky, they find exactly the tutorial they were looking for, and maybe they only need to change a few superficial things like the colours or the layout.
As they follow the tutorial, there will inevitability be bits they don’t understand. So naturally they copy and paste the code that is provided in the tutorial and tell themselves they will learn that bit later (they never do).
After following the tutorial, they make their few simple changes to make it look like their own work and then pat themselves on the back and marvel at what they have created.
The problem is, they haven’t learnt how to do anything themselves by just following the tutorial. When they go to start a similar project, they can ’t remember how to do what they did before.
So they go in search for another tutorial.
This is what we refer to as tutorial hell, you can follow the tutorial fine, but when you come to build your own projects nothing seems to work. You are in your own personal programming hell loop.
The problem is, instructors make everything look easy.
In reality, before recording the tutorial they went through the process of building the project, having it not work and debugging it until it runs.
By following the tutorial, you miss out on all the mistakes and failures, and it is often these very failures that help you remember how to do it next time around.
So how do we go about learning things, so we can actually remember them and apply them to future projects?
This was a skill I learnt at university while studying physics.
When I did A Level Physics (similar to AP courses in the US) I had to remember around 15 equations to do be able to do the exams. At the time, I thought this was an impossible task.
Then I went to university, and it wasn’t 15 equations I needed to know, it was over 100. Not only that, but I had to be able to derive them from first principles.
The thing is, that actually made it easier to learn them. The first principles were really just the 15 equations I had already learnt. I was building on top of previous knowledge. To get to the other equations, I had to understand how the scientists came up with them originally.
I had to understand the meaning behind the equations.
What I didn’t know at the time was that by understanding the physical meaning behind the equations, I was engaging different parts of my brain in order to remember them. In my head, I was picturing what lead to the equation, whether it be planets orbiting a star or the interaction between the atoms.
You see this a lot with memory athletes, those people that can remember a complete deck of cards in a certain order. They don’t try and just dryly remember the cards. They imagine a room and associate different cards with different objects as they look around the room.
The key here is they are engaging different parts of their brain to help them remember.
Now, obviously learning to code isn’t like remembering a deck of cards or a scientific equation.
When you are following a tutorial, the key is to understand what each line of code is doing, instead of just blindly copying it.
Once you have understood what that line of code is doing, write it down in your notebook or draw a diagram. The act of writing or drawing will help you use different parts of your brain and therefore will help you remember it.
You don’t want to rely on tutorials to build out projects. You need to try and build things yourself with what you can remember. It is fine to Google the syntax for things, I still do it now, but don’t go searching for the solution straight away.
Yes, you are going to struggle when learning to code, but it is the struggle and overcoming those obstacles that help you become a better programmer.
When you manage to solve a problem yourself, it is going to be much easier to solve it next time you come across it.