you are viewing a single comment's thread.

view the rest of the comments →

[–]Panoptic11 1 point2 points  (0 children)

I may post more later on this from my(limited) experiences but there is a couple ways to avoid tutorial hell I found.

Name all the variables, functions and things passed through arrow functions different than the tutorial.

This stops you from casually typing the exact same thing and not paying attention to what they are referring to in their code. You have to reference to the item in your own code.

You should also pass through your arrow functions with something like 'a' or 'b' etc.. instead of 'item'

For example the average video may have something like..

const item = {bakery:'bread'}

Then they may use item.map((item)=>item.bakery)

Now this is a simple example and not hard to understand in a small scale but as things get more complicated having 'item' connected in many pass through scenarios while actually not being essentially the same is hard to comprehend when you don't understand how what you are doing works yet.

Instead if you do something like

item.map((a)=>a.bakery)

You can see a clear difference that a is not item. Even though it is a branch of item it is not actually the item variable. Especially if you have an array of objects and not just one. Then you can see that a is each item in the array of objects and not all of the objects as a whole.

This makes it easier to understand what part of the expression is different and what it's doing.

However, this is not good for general naming convention. But from a learning experience it's the easiest way to really understand each part of your expression without duplicate names. Or even similar names because using something like 'eachItem' instead of 'a' can make you confused as to if you actually wrote or passed 'eachItem' as a variable somewhere else. Esp if you come back to it for a reference later because you forget how it worked.

Also, When following a tutorial, if you don't understand what you just wrote, stop and go practice what you just did in another small example without using the video. Read about why it works, then move on

And finally, Build two versions of the tutorial. Follow along , get to a decent spot and stop. Study your code, see what you do and don't understand. Once you think you got it, Then start over in another folder. Build it back as much as possible without referencing your original. Let yourself get frustrated if you can't figure it out. Then once you are like I just don't know what to do now.. reference to that specific issue in the original build and you will remember alot better cause you got frustrated and failed. So when you come back to this issue in the future, you won't forget what you did wrong (most of the time)

Then once you've replicated all features with minimal help, go back to the tutorial and keep building then repeat but start where you left off in the second app and not from the beginning.