3 ms·
CSS: CSS sucks. Try using Tailwind on a project and think of it as higher level language that compiles down to CSS, just like programming languages compile down
by rcarr 4y ago
CSS: CSS sucks. Try using Tailwind on a project and think of it as higher level language that compiles down to CSS, just like programming languages compile down to C or machine code. Ironically, plain CSS began to make more sense for me after I started using Tailwind.
React: This might help useState and useEffect click. Think of a man who weighs himself each week and records the change. The first week he weighs 70kg. The next week he weighs 75kg. The third week he weighs 80kg. This is his 'state' and each time he records his weight he uses setState to do it.
Now every time he weighs himself he needs to decide what to do about it. Once he hits 80kg he thinks enough is enough and decides it's time to lose weight. This is a side effect of him gaining weight. In react terms this is useEffect. useEffect runs every time he records his weight.
If you had to change a bunch of files when you changed useEffect, it's because the effects of those effects meant your program had to change for it to run successfully. For example, if this guy wanted to lose weight, he might need to increase the amount of exercise he did, or eat healthier, and so you have to find the parts of the programs that control that and have them respond accordingly.
> 3) After watching tutorials, I can't repeat what they've done in tutorial without watching the tutorial of project even though I understand each and every step they do in project.
It doesn't matter if you've been coding 2 months or 20 years, you're still going to be looking up things in documentation every day because you can't remember the exact syntax or whether a function works in place or returns a new array.
I can remember having similar feelings to you at one point and someone pointed me in the direction of this YouTube series. It helped me breakthrough the barriers I was having at the time, maybe it will work for you too:
https://www.youtube.com/playlist?list=PLKQ5LYb497AZIZe9dBWy8GwLluVaMQVj0 https://www.youtube.com/playlist?list=PLKQ5LYb497AZIZe9dBWy8...
One more thing: have a go at building a blog using Astro. You can use multiple different JS frameworks in the same site, so you could write the same component in React, Vue, Svelte, Solid etc and see how each framework essentially lets you do the same thing but a bit differently. Seeing the same thing from all these different angles may help make the underlying concept click a bit better.