DEV Community

Cover image for 4 Mistakes That Are Getting You Stuck Learning JavaScript
Carl Anderson
Carl Anderson

Posted on • Originally published at carlanderson.xyz on

4 Mistakes That Are Getting You Stuck Learning JavaScript

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

Not writing code is the number one mistake beginners make - and it's by far the most damaging in this list. JavaScript is a tool, so the best way to learn it is to use it - You can't learn to swing a hammer by looking at nails.

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

Learning paths in JavaScript are presented linearly. You have to learn all about variables before you learn all about arrays. You need to learn vanilla JavaScript before you learn React/Angular/Vue.

This linearity isn't what learning JavaScript is really like. We only teach it that way because we have to introduce you to concepts one at a time. It needs to be done in some order.

Learning JavaScript is not linear. Concepts flow into each other, and later material provides insight into earlier thoughts. Trying to "finish" arrays or vanilla JavaScript before moving on is a waste of time.

Instead, you should gain a shallow knowledge of a breadth of topics, and look it up again when you need more depth:

  1. You should know what each concept is
  2. 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

This is the mistake with the highest casualty count for would-be JavaScript developers. In the biz call, we call this "Tutorial Hell".

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.

JavaScript's core principles are concrete, so beginner resources are relatively interchangeable. A variable is a variable, and that doesn't change. It's unlikely that you're going to get much value by scrapping what you've done, and trying again.

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).

#4: You're focussing on JavaScript too much

This may seem silly, but your end goal isn't to learn JavaScript. You're learning to program; JavaScript is a means to an end - and you don't even need that much.

A large part of JavaScript consists of what we call syntactic sugar. These are features that make JavaScript more pleasant to use but don't add any new functionality.

Once you account for this syntactic sugar, you only need about 20% of JavaScript.

If you spend too much time learning JavaScript, you'll eventually be re-learning things you already know. Your time is much better spent studying general programming concepts.

Here are some concepts to get you started:

Some JavaScript courses cover these topics. If that's the case, you can try skipping forward.

Disclaimer

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.

The reason for skipping concepts is that we, as individuals, don't use most of JavaScript most of the time.

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:

  1. Write code until you find something you don't know
  2. Learn the thing you don't know
  3. Repeat

The crucial part is that you're out there writing code. I recommend checking out my post on how to write JavaScript and finding project ideas to get you started.


Are you stuck on JavaScript Tutorials? Sign up to my newsletter for more helpful articles to get you moving again

Top comments (1)

Collapse
 
Sloan, the sloth mascot
Comment deleted