Why is JavaScript so confusing!?

I know there are similar posts about it but the newest one is from 2020. So I wanted to open a new one here.

I am working on JavaScript last 3 weeks and it goes really slow. I had to go over each subject at least twice from different sources. Video courses, interactive project- based courses, going trough FCC challenges again… As I start to understand something a new confusing subject comes around and makes me feel like stupid again.

This week I started to read a book about algorithms because it’s something I need to work on a lot. And the book uses Python as language. I don’t know anything about Python. But I can understand it and I am amazed how simple it looks. It’s like plain English written in shortcuts. After reading two chapters in the book I even could pass few challenges of FCC Python for Everybody course without watching the source videos!

I just want to know if there is someone feels the same way. I may be mistaken for Python bc as I said I didn’t study it yet. But when you can understand a language you didn’t study at all just bc you know something about programming and then can’t grasp enough another language after spending 3 intense weeks of studying… It makes me little uncomfortable. Is it just me or this language is really hard??

I like building projects with JavaScript by the way (as part of interactive courses). I learn faster when I see what an array or function does in real world. But studying it through documents and challenges is not fun at all! I feel like I am giving a lot of time and getting very little in return. Just before writing here I searched for tech jobs that don’t require advanced JavaScript knowledge. :laughing: Found machine learning and data analysis! Then I thought I rather study math and advanced algorithm. I am not very good in those subjects either. But that seems more beneficial as time I spend and knowledge I will get.

Anyone went through similar ups and downs while studying JavaScript? What did you do to overcome it? Am I making it bigger problem than it is? How long did it take for you to use the language for small projects without going back to lessons or using Google too much? Shall I try other languages like Python and change the career path? What is the best way to understand which path is better suited for you? Seems like irrelevant question but it’s not :slight_smile: When you don’t enjoy with what you are learning, it slows you down even more.

Any answer to this post will be appreciated so much!

1 Like

Maybe the issue you are finding is that Python is just an easier language to read than many others (not just JS). It has its own quirks I believe but yes, it is more -readable-.
I can’t advise you on which way to go. But just confirm to you that sometimes some languages talk to our brain a bit better than others. I personally am a Java person. Everyone is different in their way of thinking.

1 Like

Any first programming language is hard. Python can be deceptively simple looking, but the same is true with Python. Shrugging with a first programming language is normal.

1 Like

Thanks for the replies! I forgot to add that I studied C before everything else. I can’t say I know C but I know the syntax, did some challenges with it. So I thought JavaScript will be easier to grasp. But hell no! :))

C is both simple and complicated. It is simple because the syntax of the language has a limited number of tools. Its complex because you have to build higher level functionality yourself.

JavaScript uses C like syntax but with more modern language features.

That’s right. Only subjects I passed easily in JavaScript were While/For Loops and Booleans. They are so similar with C. Objects are also similar. But when it comes to Functional Programming I start to bang my head against the wall :smiley: Hopefully they will all click someday.
Just knowing myself as a fast learner and struggling that much at the same time can be frustrating.

C doesn’t have objects. C++ does though.

Functional programming taken some time to get used to for sure.

1 Like

I understand where you’re coming from: JS, in my opinion, can sometimes feel like an overpowered chainsaw attacking certain problems (the Array.reduce() method, if you’ve gotten to it, can be this way), while other times it can feel like a horrible mashed-up dumping ground of conflicting programming syntaxes and concepts.

As someone with an interest in the history of computing and how computing developed, I wondered if this might have come from JS’s historical development, and I think it does. JS was created in a week by a Netscape employee as a means of introducing basic animation into static webpages. Since then, the web has exploded, and what we ask our browsers and webpages to do is nothing short of insane. JS has worked to keep up, but at its core, it’s that same, quite basic language meant to build web animations.

Now, to turn to your last question. My own experience with JS, just like any other complex skill (like a human language or a sport) has been constant hills and valleys: you encounter once concept, it’s horribly confusing, you hack through it, you start to get it, then you successfully employ it, and soon enough, you’ve mastered it and wondered how you never got it in the first place. What I’d encourage you to do, though, is learn more of the fundamentals of computing that Python tends to obscure away, things like variable scope, properties of arrays and objects (and why they work the ways they do), and at its more basic, how computers function. A great course for this outside of FCC is Harvard’s CS50x, though I warn you, it’s mostly taught in C. It’s a great challenge, and if you finish it, you’ll come back to JS and think it’s a breeze - with some quirks.

Even if you don’t do any of the more basic elements of CS, I’d also recommend you learn more about the basics of the web, particularly the Document Object Model (DOM), and how webpages go from a remote server, to your browser, to rendered on the screen. This might help you develop a more intuitive sense of why JS has some of the unique quirks it has, such as those really long, chained DOM element and method names (e.g., document.getElementById(“id”).blah blah blah).

One last thought: Python is quite easy syntactically, but I once heard an experienced programmer say that “it’s very easy to write bad code with Python.” Just another word of support for starting with the basics first.

1 Like

Thanks for the detailed answer.

This part is plain explanation of my feelings!

I started CS50 before exploring FCC, finished the first three weeks. Did the assignments of 2 weeks and gave a break. Then started to FCC.
I am thinking about going back to CS50 soon, feeling I can understand it better now. I also started to read about algorithms.

Funny enough when I first learned about DOM during an interactive JS course I got it easily. This is the part made me enjoy the language. You see it in action. I loved it!

Thanks for the advice. I will definitely go through CS50. Actually I started to watch it from the beginning and things are making more sense now. It makes me want to learn more.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.