On a good day, programming feels like magic.
You patiently enchant the machine with a tapestry of digital spells. With a few confident keystrokes, you breathe life into the colorful dots on the screen. Oh, what a marvellous illusion you have created! It works…
Except when it doesn’t.
It strikes you just as you were about to go home. It strikes you during a pair coding session. It strikes you in the middle of that interview.
A bug that you can’t explain.
You read the code again and again, but you can’t spot the mistake. The articles you’ve read and the tutorials you’ve watched did not prepare you for this moment. Or did they? You’ve had to learn so much in so little time…
Your mind is blanking.
You try a few different things. Should you remove this line? Reorder those two other lines? Maybe it will somehow just work if you try it again?
Your confidence wanes with every attempt.
Soon, a voice in your head becomes impossible to ignore.
I don’t know what I’m doing.
I’m just trying different things hoping that one of them works.
Will I ever get good at this?…
Don’t panic.
You know JavaScript. Sort of.
You know which parts are good. Or so you heard.
Your pull requests get merged. Eventually.
But you’re feeling behind.
Why does it take you hours to fix a bug that others fix in a few minutes?
It’s not the impostor syndrome.
We all have our moments of doubt. Some of them never go away. But lack of confidence often reveals a real knowledge gap. How can you find it?
Let’s start at the beginning. When you were learning programming, you focused on writing code. That’s what programming is, right?
Uh-oh.
You’ve learned to write code, but you haven’t learned how to read it.
This is a difficult thing to admit to yourself! But it’s never too late to revisit.
Computers don’t read code the way we do. They don’t guess its meaning from variable names and familiar patterns. They read it according to the rules created by other humans decades ago. No wonder we’re in this mess!
I want to help you stop guessing.
We all guess when reading code. But to gain confidence and find that bug, you need more than that. You need to see what happens as your program runs. You need to embody your program. You need to think in JavaScript.
But you are too busy.
Aren’t we all!
It was hard enough to learn programming from scratch. Now you have to keep up with all the new libraries and their updates, all the newsletters and tutorials, not to speak of all the problems you already encounter every day.
Or, rather, you feel like you have to keep up. When there’s a fundamental gap in your understanding, it’s tempting to look the other way. But how much time do you really save if you keep making the same mistakes?
A dry book won’t test your understanding.
You could read a 200-page book about how JavaScript works. I bet you already did. Still, your code is buggy and you don’t know why. A book can’t verify whether you really understood the concept. It just keeps on going.
A video walkthrough won’t help you practice.
It’s fun to watch someone build something. It feels like you’re making progress. Only, when you try to repeat what you saw, you get stuck on completely different things. But hey, at least that was engaging.
The problem is simpler than you think.
Over the years, I’ve talked to hundreds of developers.
From checking their mistakes, I’ve learned that it’s not advanced topics that caused them most trouble. Their learning efforts were misplaced.
Most of their mistakes were due to misunderstandings in the fundamental concepts like variables, values, objects, properties, and mutation.
But this is good news!
Face your misconceptions with no judgement.
A misunderstanding that could be fixed in ten minutes can cause problems for years. I had to stumble my way through them on my own.
You don’t have to repeat my mistakes.
Take a shortcut.
Just JavaScript.
Discover and rebuild your JavaScript mental models.
You know how to use a phone. Close your eyes and imagine holding your phone in your hand. Even if your imagination is as poor as mine, you know how to make a call. Or how to send a text. Or how to open the browser.
This is because you have a mental model of your phone. You mostly remember how it works, so you can recreate its behavior in your mind.
We’ll be doing the same, but for JavaScript concepts you already know.
Just JavaScript is not a course for complete beginners. Yes, we will cover variables, values, and objects. But we won’t be talking about how to use them. You already know that. We’ll focus on how to think about them.
Let the big picture unfold before you.
What happens in your mind when you see an assignment? What does a nested object really mean? What can you do with different kinds of values? Why do you sometimes get undefined, and sometimes a crash? Why does changing one thing affect another thing? Why aren’t two objects equal?
These questions often confuse developers—even with several years of experience! By the end of this course, the answers will become obvious.
With the right mental model, all of the puzzle pieces “click” together.
Author(s): Dan Abramov; Maggie Appleton
Year: 2021