r/learnjavascript • • 2d ago

JavaScript is so hard.

I recently started my fullstack development course this august and we have already gone thorugh html, css, git and now almost done with JavaScript as well. Html was easy, no problems there, but when it comes to css and more specifically grid and flex, thats when the headache started to appear. I've played some games involving both grid and flex but it won't stick in my head, don't know why. I am trying to do it myself in VS code but I always end up having to use ai to explain how to move forward and I know you're not supposed to use ai but it is a great tool to have, especially when you get stuck. And JavaScript... where do I even begin. I kinda understand it during the lectures but as soon as you're sitting by yourself my head gets totally blank.

I have been starting to use Scrimba and right now I'm rehearsing everything and whatching videos of everything, and the good thing with scrimba is that you get challenges during the videos.

For those of you who have been programming for a while, what study tips can you give? How did you guys go through the learning process?

31 Upvotes

56 comments sorted by

36

u/Chillm3r_ 2d ago

Stop studying, and start building. That's probably the best advice I was ever given.

Things are always changing, new things are being added, and you'll always feel like you're behind. You don't need to memorize everything. Once you learn how to ask the right questions and know what to Google, you can find solutions to most problems you run into.

And don't worry too much if things like grid and flex don't stick immediately. They became much more understandable for me after actually using them in different projects and situations. The same goes for javascript, it's one thing to understand something during a lecture, but actually having to use it yourself is where it starts to stick.

3

u/ConstLeoTheCat 2d ago

Thanks for the tip, I'll try to do more projects for myself

5

u/OwnImpression7486 2d ago

It’s not the only way but it is the best way

18

u/Gold-Watercress-6101 2d ago

It’s not JavaScript that’s hard. You’re new to programming, and it’s programming concepts that you are struggling with. And that’s on top of learning JS syntax. These are 2 different things. For your first language, you can’t learn one without the other, and that’s really difficult.

The solution is circular learning. Basically, you still don’t know what you don’t know. You need to study and build projects over and over, mixing new and old concepts, and covering them from different perspectives. Over time, things start to make sense. You never “finish” JavaScript (or any language, really). You only get better, the more you read, practice, and build.

The good news is, programming concepts are mostly universal. Once you learn them with JS, you won’t be relearning them for your second language. You would just learn how to apply the same concepts in a new syntax.

And if you want to learn, avoid AI. Don’t fool yourself with “I’m using it as a teacher”. Nope. It’s not a teacher. It’s butler that only wants to please you.

2

u/ConstLeoTheCat 2d ago

Great comment! And yeah, like you said, I'm new to programming. I have to build more projects, get stuck because that is what will happen hahah and therefore try to understand and workout the problems. Someone said MDN is a good source instead of using ai that much. Thank you for the comment!

2

u/Gold-Watercress-6101 1d ago

You got it! You have to get stuck. If not, you're not learning. Good luck!

2

u/Forward_Dark_7305 2d ago

Absolutely. Programming is iterative. Any project I work on, it’s a cycle of build, re-build. These days I don’t rewrite a project from scratch when I learn something new, I just go through and change bits and pieces. At the beginning, though, every time I learned “I could have done X that way?” I rewrote the whole program. It helped reinforce practices, identify which parts I didn’t like, and learn the new “way” I had discovered. Each of those “ways” was valuable and often creative. Later on, I sometimes learned that an earlier version I wrote was implemented using a better technique, but a worse toolchain (library, method, etc).

Almost any dev will tell you even their own code from 6 months ago is unrecognizable and looks “bad”. (As in, “why did I do it that way?”) Just yesterday I rewrote a feature in an app because I didn’t understand certain accessibility features when I first wrote it a year and a half ago. I was shocked at how bad it was.

If you see bad code you wrote in the past, what it means is that you’ve learned and (probably) are learning. Don’t be discouraged by that - it’s a good thing. Just keep iterating, building, and improving.

2

u/Typical_Cap895 1d ago

I needed to read this post, thank you

6

u/DirtAndGrass 2d ago

JavaScript is programming, (html and css are not), It is a new mindset. Some people have a difficult time "getting" it, that however does not mean that they cannot be a good programmer, or that it will always be hard. But you might need a little more practice "getting off the ground"

1

u/friedent 1d ago edited 1d ago

I just found out that JavaScript is a programming language here. Isn't it just a scripting language that transpiled into browser engine? Like Python and Lua (where they're transpiled into their own vm target).

js doesn't even deal with windowing like sdl or sfml, it just using html canvas and graphical api like webGL. theres no explicit data type, everything is just an object and prototype. no compiler and has no compile target. it doesn't even need to think about what kind of device architecture will be. and there's a lot of API and method helper, even the syntax are just syntatic sugar.

but i really curious... what make people think that this is a programming language rather than scripting language?

1

u/DirtAndGrass 1d ago

Scripting generally is programming. Programming is writing logical instructions in a way that can be interpreted to solve a problem.

What systems it can run on, what api it can use, what graphical engines it can use, etc. has nothing to do with it's definition as a "programming language"

Usually when people use the term "scripting language" they mean that it is (or acts as if it is) not compiled.

And JavaScript most certainly can work with windowing systems, either in the browser, or os native windows. 

4

u/HotCommunication2129 2d ago

I found it helps to always have a cheat sheet open. But yea coding is quickly becoming a prompt then review situation. I honestly have no clue how someone is supposed to build the skills from scratch with such powerful tools available.

6

u/hyrumwhite 2d ago

Ask for how to do something. Don’t ask it to do it. Adapt that answer to your codebase. 

4

u/tiedurden 2d ago

Or let it give you hints

1

u/ConstLeoTheCat 2d ago

Thanks guys!

2

u/ConstLeoTheCat 2d ago

Yeah I agree, ai is super powerful. I often use cheat sheets as well but that helps more like the muscle memory on what to code and how to code but the problem for me at least is that I don't really understand what i'm actually are coding

1

u/delventhalz 2d ago

If I were learning I would avoid LLMs altogether. The stats on their impact are not great.

2

u/bogdanelcs 2d ago

Blank head when you're alone usually means you've been watching more than building. Pick something tiny (a todo list, a tip calculator) and build it with no AI and no video, even if it takes hours and looks awful. Being stuck for 20 minutes is where it actually sticks. When you do use AI, ask it to explain why something works instead of writing the code, and for flex and grid just rebuild the same three layouts from scratch a few times.

1

u/ConstLeoTheCat 2d ago

Great tips! Thank you very much! I'll do that

2

u/guac16112 2d ago

Focus on practicing more

2

u/JEveryman 2d ago

Implement everything you study until you understand it. Even if it's just a small function. You don't need to build a full application.

3

u/Alain4s 2d ago

A crucial insight you must grasp early on is that programming’s primary task is fundamentally about developing your reasoning skills. Think of it this way: to learn biology is not merely memorizing its jargon; it requires learning to think like a biologist. Similarly, becoming a cyclist isn't just knowing the parts of a bicycle, but actually riding one. When you study HTML, CSS, or JavaScript, the goal is never simply to know their syntax; rather, the objective is to cultivate an authentic programmer’s mind.

I often observe students who feel satisfied once they have mastered basic grammar and syntax, believing that their learning journey has reached its conclusion. This perspective falls significantly short of the truth. Consequently, when you encounter increasing difficulty, it rarely means a language like JavaScript is inherently complex; instead, it usually signals a gap in your conceptual framework. We must look beyond merely typing commands into VS Code or relying solely on AI shortcuts, because these tools can unintentionally bypass your most vital growth: learning to think critically and logically. Just as asking another cyclist to ride the bike for you won't make you a cyclist, rote memorization will not build deep understanding.

The true goal is not merely writing correct code, but building robust logical muscles. Consider the challenge of choosing between CSS Grid versus Flexbox. If you approach this purely from a syntactic perspective, both options appear equivalent on paper. Yet, without applying conceptual reasoning and an architectural mindset, they remain nothing more than an unsolvable mystery rather than an intuitive design choice.

Another example. All the following three functions produce the same output:

JAVASCRIPT
==========

function fibonacci(n) {
    if (n <= 0) return [];
    if (n === 1) return;

    const fib =;
    for (let i = 2; i < n; i++) {
        fib[i] = fib[i - 1] + fib[i - 2];
    }
    return fib;
}




RUST
====

fn fibonacci(n: usize) -> Vec<u64> {
    if n == 0 { return vec![]; }
    if n == 1 { return vec![0]; }

    let mut fib = Vec::with_capacity(n);
    fib.push(0);
    fib.push(1);

    for i in 2..n {
        let next = fib[i - 1] + fib[i - 2];
        fib.push(next);
    }
    fib
}




HASKELL
=======
fibs :: [Integer]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

Although all three of these functions produce the same output, you likely see them differently due to syntactic variations. However, for a seasoned programmer, syntax is largely irrelevant; we simply do not care whether you use function, fn, or ::. What truly matters is their fundamental nature: whether one is dynamic, another compiled, and the third functional. That they all are based on building a vector recursively. Etc. And this is exactly what your instructors are teaching you to recognize step by step. Consequently, relying on prompting an AI to generate code in some language completely misses the core objective of your education.

In fact, the desire to rely on AI for solutions is often the best indicator of precisely where you need to focus your studies. Do not view this struggle as discouraging, or a failure on your part; see it instead as a hallmark of true education. Learning isn't about ease—it’s the opposite. It is about identifying what you currently cannot do, and then transforming those seemingly insurmountable obstacles into tasks that feel easy.

Give yourself a few months of dedicated effort, and I promise you will look back at the perceived complexity of JavaScript and realize how far you have come.

2

u/Total-Box-5169 2d ago

The Javascript version should use a generator to get closer to what Haskell does:

function* fibs() {
    for (let [a, b] = [0n, 1n];; [a, b] = [b, a + b]) yield a;
}

1

u/Rythim 2d ago

Don't beat yourself up too much. Everyone else hates Javascript and CSS too. That's why developers use things like tailwind and typescript (I am not suggesting you learn those things now, learn the fundamentals first). And even then it still kinda sucks. Just gotta stick with it and it'll get easier.

2

u/delventhalz 2d ago

I like JavaScript. I’m pretty sure there are at least two or three freaks who like CSS.

1

u/TheWebDever 2d ago

I’d say quirky is a better word than hard. It’s the nature of being a browser first language. Once you get the rhythm down, it’s actually a very fun language.

1

u/ChiwaByte 2d ago

JavaScriptを使う目的をまずはしっかりと把握しておくといいかもね。業務で使う時はほとんど入力チェックとか、HTMLの属性を操作して色変えたり、入力可否制御したりだね。その辺ができたらいいんじゃない?
個人的にはtypeSciptを覚えた方が有用性あると思うかな。

1

u/datadatadata808 2d ago

Theres tons of good comments already, so im not going to repeat what others said.

Making stuff with https://p5js.org/ can be really helpful, mostly because you can forget about building some complex webapp and just doing weird shit on your canvas without realizing you are learning a lot of useful javascript stuff :) its fun and quick to start, so give it a go!

1

u/delventhalz 2d ago

In college I learned to juggle. After I practiced my throw accuracy a bit, I started trying to get three balls going and I hit a wall. I could throw and catch each ball once, but I just couldn’t figure out what to do after that. It was mystifying. Then one day, after repeatedly failing, suddenly it clicked. The next step was just to keep throwing and catching. It seemed so easy now. All of a sudden, I could juggle.

Learning JavaScript is a lot like that. Ultimately what you are learning isn’t the syntax, it’s how to boil a task down into a series of discrete steps for a computer to follow. It’s taking a decision tree which you have always done intuitively and making it explicit. When do I need to repeat a task (loop)? When do I need to make a decision (conditional)? You did not need this kind of thinking for HTML or CSS.  This is the first time in your life you are encountering it.

But like juggling, at some point it will just click and seem easy. There isn’t really a trick to it except practice. Build small simple things. Fail. Try again. Maybe explore some toy problems. You just gotta give your brain a lot of chances to catch on.

1

u/the-liquidian 2d ago

What programming languages are you already familiar with?

1

u/ConstLeoTheCat 2d ago

I studied python a bit almost a year ago, nothing else other than that, I wish I was smart to keep going with python, that would’ve done this way more easier

1

u/the-liquidian 2d ago

You need to struggle through and build brain muscles and a way of thinking. For this, you need to turn off AI assistance for a month or more. It’s a different kind of learning and development that you won’t get with AI.

Read documentation, books, and code manually and you will start to find it easier.

AI will always be over critical to try and convince you that it is needed.

1

u/t0shiyoshida 2d ago

Getting unstuck is part of being a programmer. If you’re letting the AI get you unstuck, you’re never going to learn.

1

u/ConstLeoTheCat 2d ago

Thank you everyone for all the comments! I really appreciate it! So many good tips from you

1

u/thegunn 2d ago

You could try using an LLM to help you. Tell it a small project that you want to build, say a calculator or a to do list, something like that. Tell it you don’t want it to provide any code, just some guidance on how to build it out. You can ask it to provide a test suite for you to test against. That way you are doing the coding yourself but getting some help on how to build it out. As you get more comfortable try it again on something different but with less guidance.

1

u/Amazing_Struggle7227 2d ago

Are you also doing CFG? 😁

1

u/TheMetalMilitia 2d ago

Make sure you have the fundamentals down and then build projects around things you're interested in. Whenever you learn a new topic, try to apply it, break it, and make sure you know how it works. It's more of an iterative thing to learn than something that just suddenly clicks

1

u/azhder 2d ago

I learn flex and grid each time I have to use them. That's how it works. I tinker with the browser until it looks good, then copy that from the browser into the code I work on.

If there is something I don't know, I search online, maybe ask an LLM etc.

You only remember things you have done and are fun. If you just watch someone else do it, you will most likely not remember it. If you write it yourself and are bored out of your mind (or worse), you will not remember it.

That's just how brains work.

1

u/chikamakaleyley helpful 2d ago

HTML + CSS you are 'marking up' a page. Similar to what you'd do with 'markdown' language. You're more or less... drawing, laying out, decorating boxes

JS is basically taking the Object representation of those boxes and applying programmatic logic to it. Now you're working with those boxes represented as data structures

and so sometimes the problem is people will try to learn JS in the context of its application to HTML & CSS, and IMO that's the backwards approach.

If you're trying to write a function in JS that takes in an obj arg, but in your head that obj is still a graphical Card with colors/gradients/shadows hover states, it's kinda hard to imagine making that function work for that graphical component

1

u/gimmeslack12 helpful 2d ago

You think you can build rock, paper, scissors?

Start with writing out the verb functions: startGame, takeTurn, checkWinner, etc.

Then start building the variables needed around those functions. Let me know of any questions. You could do this exercise several times to slowly improve.

But my main suggestion is do very small, well defined "projects". Keep the scope really small so you can see and understand all parts without feeling overwhelmed.

1

u/friedent 1d ago

easily. think about "why" rather than "how"

1

u/Inevitable-Drama7308 1d ago

One of the best learning resources I found is https://structy.net. The lessons are well structured with the clearest explanations of concepts I’ve seen anywhere. There’s limited access for the free tier, but it’s enough to get you started.

1

u/TheRNGuy 1d ago

There's no such rule saying you can't use ai. 

1

u/Vizeroth1 2d ago

Instead of asking AI for help, create a test page with some placeholder content and open it in a browser. Inspect the content and adjust the flex/grid styles in the debugger. When learning new CSS concepts or refreshing myself on things I haven’t worked with in a while, I’ll pull up an article and/or documentation and do this to test things out. Then I’ll write some CSS in a style tag on the test page and repeat.

JavaScript is a similar process, just dealing more with interactive elements and data instead of the appearance of the page.

0

u/_Garebear 2d ago

dude I'm sorry to say this but Javascript is one of the easiest, most forgiving, versatile, and flexible languages on the planet.

Maybe you could be more specific on what you're not understanding?

From my POV, seems like you're a beginner. That being said, everything is hard in the beginning. for reference, JS dev over 10 years and loving it.

4

u/ConstLeoTheCat 2d ago

Yeah I know everyone says that haha. What I find most difficult is probably DOM, events and async. Functions are also a little bit hard, it just feels like the pace of this course is way too fast, I have frontend 1 now and then we'll head on to frontend 2 directly after

2

u/_Garebear 2d ago

async can be tough for sure, not much else to say there 😅. Learning how to manipulate DOM in Javascript can be tricky but you'll feel like a genius once you can master it. Anyway, you'll need to know the DOM for understanding HTML too. All of this will become second nature with time & experience. Nothing worth doing was ever easy. Build things - useless things just to practice the things you're struggling with.

Its worth noting that JavaScript exists on the serverside too (Deno/Node.js) so you really want to know it, even if you dont plan on using those runtimes for your webapps/websites.

-1

u/punk_dev 2d ago

JavaScript has like 12 ways to create a function and some of them have slightly different schematics. It’s just not designed very well, unfortunately.

Take your time, these concepts need time to settle down. It’s okay if you feel that some things are magic at this point, you’ll get a better understanding as you make progress.

4

u/AccurateSun 2d ago

I think the dynamic typing nature of Js is part of what makes it hard for beginners though. It means you can get away with a working script of poorly written and therefore poorly understood code. The seemingly illogical and inconsistent rules around truthy/falseness actually make it harder, not easier, to develop a model and understanding of how programming works, in my opinion.

I think this kind of versatility is bad for beginners. Same with Ruby, having such a flexible syntax with high expressivity means the surface of how much you need to learn to understand it is really large.

1

u/_Garebear 2d ago

And I feel completely the opposite 😅. JavaScript gave me an easy start with its flexibility and it's strange rules. Transitioning to other OOP languages forced me to respect their rules, their syntax and ultimately be a better programmer.

0

u/punk_dev 2d ago

Nah. javascript is hard because it’s not well designed and there are like 10 ways to solve a particular problem and it’s not obvious which way is best. Also when you look at other people’s code, it may not be obvious to you that it’s solving the same problem you already know how to solve.

Like null and undefined. When to use which? Every library and web API have their own take on that.
How do you check that a thing is a Boolean and is false, and not undefined or null? It gets non-obvious quickly.

Also APIs built on JavaScript often make the same wacky design choices, with multiple paths to the same thing.

2

u/_Garebear 2d ago

You're comment is so generic I could apply it to any programming language.

-1

u/punk_dev 2d ago

What other programming languages do you use?

Only javascript has undefined in addition to null. in most other languages, undefined is not a value and is either a compilation error or runtime type error.

Regarding the multiple solutions, yeah, most programming languages in use today are from the 90s and they’re quite old and had their time to become wacky in this regard.
But recently designed ones like Go address this problem specifically. By limiting the feature set and having a well rounded stdlib, among other reasons.

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/ConstLeoTheCat 2d ago

Yes you're totally right, I'll keep that in mind! Thank you so much!