I personally prefer a serious text without bringing in unrelated concepts like food, but this is still understandable.
I personally prefer a serious text without bringing in unrelated concepts like food, but this is still understandable.
The first meaning of "use for a recipe" is "use as an ingredient."
But then, it's a pretty weird thing to explain to begin with, approximately every human on the planet knows what the word "list" means. So what does this pseudo-definition add?
I don't think it's good either. You'll mostly get the meaning if you already knew it.
This does almost nothing to explain what a “list” is in the CS sense. Teaching material needs to show how a list could be used for a recipe, and from that the student might begin to form a first incomplete understanding of what a “list” is.
That you felt you need to add 'ordered ... of steps of what to do' to your definition of list, kind of proofs that a recipe is a bad analogy for a list.
A recipe contains multiple lists, has a name, has a purpose and a desired outcome. Totally different from a simple list. But a kid who's unfamiliar with the programming concept of 'list' doesn't know that, so it's very possible that at some point they will get confused when a list can't do things that a recipe can do.
- a list can be used for the steps of a recipe
> A recipe is an ordered list of steps of what to do
Understandable.
> a list can be used for a recipe
Not so much.
Moreover, a recipe usually at least consists of two parts, ingredients and steps.
"pierogi_recipe": { ingredients: Set<(Item, Quantity)>, steps: List<Step> }
So the analogy kinda muddies the waters.