Monday, March 15, 2010

Cooking as Coding

If it is not already obvious, one of my favorite hobbies is cooking. Recently, as I was toiling away on a seafood risotto, I had a realization: cooking is a form of coding. People might enjoy cooking for many of the same reasons people enjoy coding. If you think about it, the similarities between these two activities are striking:

  • Fundamentally Creative. When you cook, you are engaged in a fundamentally creative task. You are using your hands and your skills to build something. This is no different than when you sit down to code; you are the master of your food (or program’s) destiny.
  • Scientific Basis. Cooking is not a realm of mysterious alchemy. It is based upon rigorous principles of chemistry and physics. To create a delicious meal, you need to obey those scientific principles. When you write code, you similarly ought to understand the computer science and mathematics that underlies your work.
  • Real-Time Debugging. Coders love to constantly test and debug in real-time. They like to quickly write a function, test it out, and revise it as needed. The same is true in cooking. Debugging consists of sticking your spoon in and having a taste. Then you adjust your ingredients or technique as necessary.
  • Open-Source Documentation. Within both cooking and coding, there is a beautiful culture of sharing knowledge. Cookbooks, of course, are a form of open documentation. More importantly, ask most anyone for a recipe of something they’ve made, and they oblige. Both cooks and hackers take a pride in their creations and love to share their code/recipes.
  • Black-Box Abstraction. Meals can be modularized into constituent parts. For example, a pie consists of a crust and filling. To make a pie more easily, you can use an off-the-shelf crust, even if you don’t know how it was made. This black-box abstraction resonates well with a programmer’s instinct to reduce complexity through modularization.
  • Instant Gratification. This might be the most important attribute. In many fields of engineering, you have to wait a long time to see the results of your work (e.g., building a bridge). The fact that coders can quickly play with their creations is what attracted many of them to computer science in the first place. Cooks get to enjoy this exact same kind of instant gratification. A chef’s code is edible!

Given the vibrant similarities between cooking and coding, I would love to see software engineers have a stronger influence on the discipline of cooking. Beyond the gizmos of molecular gastronomy, here are a few more cultural ways engineers could improve cuisine:

  • More science-based culinary training. With the exception of Harold McGee’s On Food and Cooking, very few (cook)books teach much about the science of food. As a result, very few people really understand the science behind cooking. This inhibits their creativity in the kitchen. Instead, it’d be wonderful to see more cooking texts that teach science– from the physiology of taste, to the chemistry of ingredients, the thermodynamics of heat transfer.
  • More innovative recipe templates. The canonical recipe template (e.g., opening notes, ingredient list, prep instructions) is out of date. There is a lot of room to innovate on how we articulate recipes. There are, for example, better ways of visualizing parallel activities, or incorporating video demonstrations of standard techniques. Recipes need to come into the 21st century.
  • More knowledge of reverse-engineering. Whenever coders come across a new piece of technology, they try to figure out how it works. They are masters of reverse-engineering. People are often the same way when they enjoy new dishes at restaurants. By devising better a more rigorous methodology for reverse-engineering meals, people could greatly enhance their cooking technique.

Can you think of other ways the culture of computer science can enhance the culinary world? Given that software engineers revel in both the artistic and technical demands of the creative process, I think that geeks are bound to make fantastic contributions to the culinary arts.

[Via http://blog.samidh.com]

No comments:

Post a Comment