avatarJ.A. Becker

Summary

Learning JavaScript can be challenging due to its complex syntax, disorganized code practices, expert-level tutorials that often include frameworks, and the common mistake of starting with advanced frameworks before mastering the basics.

Abstract

The journey to learn JavaScript is fraught with obstacles that can daunt both beginners and experienced programmers from other languages. The syntax of JavaScript is notoriously difficult to read, filled with punctuation that doesn't align with natural language pauses or emphases. Additionally, the lack of code organization in many JavaScript files leads to 'Spaghetti Code', further complicating the learning process. Tutorials created by experts often exacerbate the problem by using frameworks and libraries like jQuery, which can confuse learners who have not yet grasped the fundamentals of the language. Lastly, the temptation to jump into advanced frameworks like React or Angular before understanding Vanilla JavaScript can lead to frustration and premature abandonment of the learning process. Overcoming these challenges requires patience, practice, and a methodical approach to learning, starting with the basics and gradually progressing to more complex concepts.

Opinions

  • The syntax of JavaScript is likened to a "nightmare" and a "run-on sentence", suggesting it is far from intuitive.
  • JavaScript's heavy use of punctuation is seen as a significant barrier to reading and understanding the language.
  • There is a strong opinion against poorly organized 'Cluster F*ck Code' that is common in JavaScript projects, advocating for moving on from such tutorials.
  • Experts are criticized for being poor teachers due to their tendency to use frameworks and libraries without explaining the core language, which is compared to teaching shorthand before teaching English.
  • The article emphasizes the importance of learning Vanilla JavaScript before attempting to use frameworks, framing it as a necessary foundation for understanding.
  • The author believes that perseverance is key, as the initial hurdles of learning JavaScript can be overcome with time and dedication.
  • The author calls out the misconception that one can quickly become proficient in JavaScript, highlighting that it is a lie and that the learning process takes considerable time and effort.

Why Can’t I Learn JavaScript?

4 reasons it’s so damned hard.

Image by Lorenzo Cafaro from Pixabay

For both newbie developers and veterans crossing over from another language, learning JavaScript is an uphill battle.

Don’t be fooled by the lies. It takes time, effort, and monumental resilience on your part to push past its brutal starting gates and get to the point where you can build something of value.

But it’s worth it. It’s a powerful, flexible language that can make you a lot of money. And it’s been, and will continue to be, a persistent fixture of the internet. So learning it is of long-term value for you and those that depend on you.

Here are four of the most challenging stumbling blocks to learn JavaScript and how to overcome them.

1. Nightmare Syntax

The first JavaScript hurdle you need to overcome is its nightmare syntax. Some languages are smothered in Syntactic Sugar and are elegantly constructed so they are as humanly readable as possible.

And then there’s JavaScript:

Image by Markus Spiske from Pixabay

I come from a technical writing background, so to me JavaScript is like the world’s worst run-on sentence. Bracket, [content], bracket, [content], comma, [content], semi-colon, semi-colon…it’s a damned challenge to read.

() => { If (you can’t easily {(and naturally;)} read a language), {then you are going to have a => hell of a time learning it;}}.
}); });

How to overcome

All programming languages have this challenge, but JavaScript is extra special with the way it’s constructed. It uses a hell of a lot of punctuation ({},:.’’;()), which your brain is trained to understand as pauses in thought, emphasis, breaks, and so on. But they don’t mean the same in JavaScript. So it’s a jarring, confusing experience reading JavaScript for the first time.

There is no way around this, you just have to get used to it. But knowing that just reading the code is part of the battle can give you comfort. It’s not you — it’s JS — and it will take time.

Image by J.A. Becker

One way I bridged this gap was to copy all the tutorial code into my IDE and add spaces, indentation, code comments, and so on to make it more legible.

Obviously, because it’s a tutorial the code should have been written this way in the first place, but it’s not. It never is. You have to do it yourself. People would think I was crazy and would laugh when they saw me in class formatting all the code samples. But honestly, this was the only way I could actually read this stuff.

Eventually, your brain retrains itself to understand the punctuation differently and you can actually read it. But you have to hang in there for quite some time until it becomes secondary nature.

2. Cluster F*ck Code

Some languages force you to sensibly organize your code, but with JavaScript anything goes. Often, lazy developers dump everything into a single JavaScript file, which makes it a nightmare to read and understand. An impenetrable mess of Spaghetti Code!

Image by Jörg Husemann from Pixabay

How to Overcome

I don’t put up with this sh*t anymore and just move onto another tutorial.

The internet is stuffed with getting starteds, learn to code in 10 minutes, bootcamps, books, and so on. If you run into a tutorial that has code like this, dump it and move on to one that doesn’t.

That’s right! Don’t waste your time parsing through spaghetti to find a single strand of meaning. I recommend that before you even begin a tutorial, look through its code and see how spaghetti-like it is. If it’s a mess, then move on to the next one.

3. Tutorials Are Made By Experts

Experts are the worst teachers. They don’t know what it is to not know — if you know what I mean — and often do more damage than good.

My first intro to JavaScript course had this in one of the code samples: $(“#myDiv”). Supposedly, according to the class notes, this is the most simplistic JavaScript code to understand. All it does is scoop up a myDiv element.

So I try to run the code locally and I can’t. This keeps popping up:

Uncaught ReferenceError: $ is not defined

JavaScript developers will laugh because what’s wrong here is. But to a newbie, this is a Grand-Canyon-like gap in understanding.

The problem is this ain’t JavaScript, it’s JQuery. And so many tutorial creators use frameworks and helper libraries to explain JavaScript basics. This is like teaching somebody English by first teaching them shorthand. It’s insane.

How to Overcome

You need to evaluate the sample code before you begin the course, book, blog, or whatever your starting. Look at what’s imported and required in the JavaScript file.

If you are seeing something like this at the top of the JavaScript file:

…then stay away. Clearly, this person knows how to code but doesn’t know how to teach. Those are two very different things.

Also, knowing the differences between JavaScript and its libraries and frameworks can help you differentiate the two which all the ‘expert’ instructors blend together:

4. Running Before You Can Walk

Everybody wants to build something amazing from the get-go, so they fire up a React, Angular, etc, tutorial to get started (cause those things look amazing). Resist this temptation ! You will fall straight on your face because learning this way is impossibly complicated.

You should never learn a framework first and a language second. It’s rediculous, but a Aalot of developers try this, get frustrated, cold feet, and then quit. Then they blame JavaScript for their failure. Nuts to them!

How to Overcome

Learn to walk before you can run. Start your JavaScript adventure with VanillaJS (plain JavaScript) and learn the basics before you leap into advanced realms. Even if you are an awesome Java, PHP, C++, or whatever, you need to learn the basics before moving onto advanced tasks.

VanillaJS started as a kind of backlash joke against all the overwrought JavaScript frameworks that were choking the internet. Now it’s becoming an actual back-to-basics movement, which is a fantastic way to learn JavaScript.

Great VanillaJS learning resources:

Also, if you are going to buy a book, this is a fantastic soup to nuts VanillaJS resource:

Final Thoughts

Often, in life and learning, it’s not the complexities of the task that cause us to stumble, it’s the stupid little things that knock us off course. And the journey to learn JavaScript is filled with many stupid little things.

Hopefully, I’ve captured the key 🤦‍♂ to help you streamline your learning.

Remember too, that everybody lies. People who say they got started with JavaScript and were banking bucks in 4 months time are all lying. It took them years to learn these skills. Trust me. Don’t feel bad if you don’t get it in 4 months or even 6 or even longer. Everybody learns at their own pace and nothing is wrong with what.

And remember: the hardest part of any journey are the first steps. Once you surmount those, the going gets easier and easier.

Good luck, good learning, and good programming.

JavaScript
Programming
Learning To Code
Software Development
Technology
Recommended from ReadMedium