Being a geek who likes to bake brings with it some exciting conflict: on one hand I’m a very methodical cook, following the recipes to the number and being all ‘mise en place‘ about organizing the kitchen. On the other hand, there’s so much that is sense-based: beating to soft peaks, cooking until ‘nut coloured’, ‘not over-mixing’, etc. Recipes are a blend of the reproducible and the non-reproducible.
This got me to thinking how chefs come up with recipes. What makes one recipe for tomato soup different to another recipe for tomato soup? Why did they make that change? Is it based on something they read elsewhere, or is it just from experience? Partly it comes down to chemistry (kneading to form gluten strands, or using baking soda to produce CO2), but I’m sure there must be some happy accidents or successful tests that lead to alterations.
So, I wanted to compare some recipes. I started with brownies, as these have a very simple recipe, but also a combination of different ingredients, processes, and subjective measurements. And then I shifted to some pseudocode:
ingredients:
200g of 70% dark chocolate
250g of unsalted butter
360g of caster sugar
4 eggs
65g of plain flour
80g of cocoa powder
1tsp of baking powder
X = recipe:
O = preheat(oven, 180C)
G = line(tin, greaseproof paper)
A = wmelt([chocolate, butter])
B = stir([cocoa powder, flour, baking powder, caster sugar])
C = stir([A, B))
D = beat(eggs)
E = stir([C, D]) until silky
F = fill(G, E)
bake(O, F, 25)
This brought to light a few interesting questions:
- What happens to the variables? Once
stir([A, B])has been performed, A and B no longer exist in that form. Any reference to them should probably fail. If we hadB=100g of Athen A would then weigh 100g less – or would another variable be created implicitly? - Which steps can be optimized? If we’d had
B = stir([cocoa powder, flour])andB2 = stir([B, baking powder, caster sugar]), how would we know that the two can be combined? - Is it possible to tell when operations can be handled concurrently? If there were two cooks in the kitchen, one could have handled the creation of A, and the other the creation of B. But what if creating A somehow impacted the creation of B?
The next step is to make a parser for the above, possibly with some minor changes to address the questions, but I’m keen to keep any recipe language flexible enough to keep the ‘sensual’ aspects, even if it means that it cannot be run by a machine. For me the interest lies in comparing recipes, seeing where processes are equivalent, or taking aspects from one recipe and applying them to another. Watch this space!
Now I want brownies.
I was reading a journal article last week that put me in mind of this post! http://www.sciencedirect.com/science/article/pii/S1574119210001240
It goes into a lot of depth about how you’d program the following of a recipe, in this case making tea. (See Table II, for instance.)