12
The way my buddy explained CSS selectors finally made it click for me
I was at a coffee shop last Thursday and my friend Jake just drew a little tree on a napkin. He labeled each branch as a parent or child element and showed how selectors travel down the tree. I had been struggling with specificity for like 2 months before that. Has anyone else had a random explanation from a friend that just stuck way better than any tutorial?
3 comments
Log in to join the discussion
Log In3 Comments
johnson.paul1mo ago
Man, that napkin tree thing is exactly what I needed to hear too. I read somewhere that people remember stuff better when it's tied to a picture or a story instead of just text. @patriciah51, you're right on about that. I had a buddy once explain flexbox by comparing it to people standing in line at a food truck, and that really clicked for me way more than any long tutorial ever did.
8
amy_coleman211mo ago
Wait, is that always true though? Sometimes those analogies just overcomplicate things, like when someone tried to explain JavaScript closures to me using a "chef in a kitchen" story and I was more confused than before I asked. I think @patriciah51 there are times when you just need the raw code or the formula spelled out, not a metaphor that leaves room for interpretation. For example, when I learned CSS Grid, the actual documentation with its simple diagrams worked way better than my friend's "bookshelf" analogy that fell apart for nested grids. Analogies can be great but they can also box you into a wrong mental model if you're not careful.
5
Doesn't it seem like the best way to learn anything is when someone ties it back to a tree, a map, or something you see every day?
2