←back to thread

359 points FromTheArchives | 1 comments | | HN request time: 0s | source
Show context
Imnimo ◴[] No.45293673[source]
I looked at the example for computer science basics for a 7th grader interested in food. Explanations include:

"a list can be used for a recipe"

"a set can be used to list all the unique ingredients you need to buy for a week's meals"

"a map can be used for a cookbook"

"a priority queue can be used to manage orders in a busy restaurant kitchen"

"a food-pairing graph can show which ingredients taste good together"

Maybe I'm over-estimating the taste of 7th graders, but I feel like I would get sick of this really quickly.

replies(12): >>45293709 #>>45293849 #>>45294241 #>>45294326 #>>45295433 #>>45295632 #>>45295729 #>>45295945 #>>45296066 #>>45297739 #>>45300529 #>>45301902 #
iLoveOncall ◴[] No.45295632[source]
My issue with that it's more that those are extremely poor analogies.

The first 3 are simply plain wrong.

GenAI's gonna GenAI I guess.

replies(2): >>45295859 #>>45296128 #
CodeMage ◴[] No.45295859[source]
Okay, maybe I'm dumb, but I don't get how the first 3 are "simply plain wrong". They're open-ended enough that I have no trouble imagining how you could use those 3 data structures for those 3 purposes, so I must be missing some aspect of what you're trying to say.
replies(1): >>45296039 #
iLoveOncall ◴[] No.45296039[source]
It's not that they cannot be used. You can use any data structure for any purpose if you torture it enough. It's that the metaphors are terrible.

> "a list can be used for a recipe"

A recipe is not just a list of steps, it's also a list of ingredients, potentially an introduction, some pictures, etc.

Ask a kid to draw you a mock recipe, you won't just get a list of steps in return.

> "a set can be used to list all the unique ingredients you need to buy for a week's meals"

Ingredients have quantities attached. If I tell you to make a cake you need sugar, an egg and flour and give you all the steps but no quantities, you're not making a cake. A map is the obvious choice for storing ingredients.

I agree that ingredients are unique, but they have attached data which is just as relevant as the ingredient itself.

> "a map can be used for a cookbook"

I just don't understand how a cookbook is supposed to represent a map, it just doesn't make sense, not even with the additional context of the previous metaphors.

At best it would be somewhat understandable if it said a map can be used for a cookbook, with dish names mapping to recipes, but even this would be a stretch and assume a dish can be made in a single way.

Keep in mind the goal is to teach someone who has zero ideas about datastructures what they are, not to give some analogies to an experienced software engineer.

replies(2): >>45296443 #>>45297776 #
1. recursivecaveat ◴[] No.45296443[source]
My beef with the list is what does "a list can be used for a list of steps" explain? Feels like the sort of thing you nod along too and then wake up the next day realizing you didn't learn anything at all.