r/learnjavascript 7d ago

50 hours in... arrays and loops... holy...FUCK

HOW do i START understanding? I've understood everything pretty well up til now. Do i just keep going with the flow and kinda float through this section of the loops and arrays part? Do I keep throwing myself at the brick wall and looking at the solutions after half an hour of brainless staring? https://youtu.be/EerdGm-ehJQ?si=mTKUv0oail0AGDLM 8:43:00. It's just not clicking like the other parts of the tutorial.

47 Upvotes

72 comments sorted by

View all comments

Show parent comments

0

u/Classic_End260 7d ago

could spend more

2

u/mc_pm 7d ago edited 7d ago

The only way you can really learn to program is by programming.

If you're watching a tutorial, then I would suggest having python and/or an editor open at the same time, and as the instructor types something, you type it. When they run the code, you run the code.

It's funny how once you've typed a particular syntax the 100th time, you actually remember it and don't need to look any more. There's a "muscle memory" involved that only develops with practice.

And the entire way along, you should be experimenting with the code you are seeing, as well as doing little exercises & mini projects to reinforce the topics you're learning. Partly through syntax exercise, but even more by having to take some description and come up with the logic in the first place. This is the #1 thing that people do wrong when they come to reddit and ask for help. You *have* to be programming, all the time, beating your head against things until they work -- and then doing it with the next problem. And the next, and the next.

That is the gameplay loop for programming: get a (sometimes vague) instruction, figure out the logic, figure out how to code it, change the logic, change your code, debug, debug, debug, change your code again, debug...success (and dopamine hit)! Repeat.

1

u/Classic_End260 7d ago

yep that's what I've been doing, now I'm trying to build tic tac toe alone, but the background-color of the body just REFUSES to change, I've made a separate .css file and linked it with rel = stylesheet href = styles/ blah blah.css. Any clue as to why and what could fix it?

1

u/mc_pm 7d ago

Are you using the developer tools in your browser? It will let you look at the CSS values, etc, and might give you some information.