B
22

Explaining arrays with a book shelf made my roommate's day

I was working on a small JavaScript project at home, trying to organize color codes for a client banner. My roommate peeked over and asked why I had all these lists in brackets. I said it was like a book shelf where each book has a spot, and you can pull any one out by its number. He nodded right away and said it made sense now. We talked a bit more about how loops could go through each book on the shelf. It felt really nice to help someone see coding in a simple way. In my experience, using everyday things to teach basics works well. Now he's curious about trying some code himself, which is a win in my book.
3 comments

Log in to join the discussion

Log In
3 Comments
young.kim
young.kim2d ago
A friend of mine once taught her little sister what a variable was by calling it a coffee order. She said it's like telling the barista you want a large latte, and that name holds your whole drink order. The kid totally got it and started naming her toys after variable ideas. Seeing that click happen is the best part of sharing this stuff. Those simple, real world comparisons just cut through the confusion. Her sister still asks if she can "declare a new toy" sometimes.
4
daniel_martin
Wait until she asks if she can put her toy in a "for loop" next. That's when you really know the lesson stuck.
4
rileym96
rileym962d ago
You're telling me a kid actually says 'declare a new toy'? Unreal!
4