When learning to code, you expect to struggle. There's a lot to learn, and it won't all come easily. All you need to do is put your head down, work hard, and chip away at the difficult places bit by bit.
But what if you've been "chipping away" for weeks with no results? Every time you try to grind through the next chapter or work out how to write that first line of code, you get nowhere! You don't get it.
You're stuck - and you have no idea what to do.
Did you miss something important? Do you need to start over, and pay more attention to the basics? What are you doing wrong?
The good news is that you're not the first person to ever get stuck. I'm going to cover four common mistakes and provide advice on how to get past your sticking point.
#1: You're not writing code
I've covered it before in this article - solving problems with code is different from knowing the language. You're going to have to learn this skill eventually, and the sooner you start, the better.
Courses will often include some programming exercises, but these aren't enough. You should aim to make your own programming decisions, instead of finding a predetermined solution. With that said, exercises are better than nothing.
You can check out this article if you want help thinking up project ideas.
#2: You're trying to complete topics before moving on
Instead, you should gain a shallow knowledge of a breadth of topics, and look it up again when you need more depth:
- You should know what each concept is
- You should vaguely understand when/how to use it (so you know when to look it up again)
That's it. When you're writing code (see #1), that's your chance to revisit these concepts and understand it more.
If you're stuck with a particular concept, move on and come back to it when you need it. There's a good chance that more advanced ideas will provide the insight you need.
#3: You're starting over again
When you're completely stuck on a concept, it's tempting to find a new resource and start over. Maybe this one will teach you in a way you understand?
Don't do this.
What you should do instead is practise writing code with what you already know (#1). Rather than spending more time with a concept, move on and go back when you need (as in #2).
Here are some concepts to get you started:
- Boolean algebra (truth tables)
- Graph/Set Theory. See this article too (Warning: Mathematics)
- Dijkstra's Algorithm
- A* Algorithm
- Sorting Algorithms
- Data Structures
In this article, I've told you to skip over concepts and ignore large swaths of the language. This doesn't mean you shouldn't expect to learn these concepts eventually.
Rather than focus on learning a specific concept, you should be writing code. Try to create situations where you need that concept - then revisit it.
This creates a basic virtuous cycle:
- Write code until you find something you don't know
- Learn the thing you don't know