Not content to make just a cooking post or just a computer science post, here is my post of computer science as applied to cooking. Hopefully this will provide an approachable introduction to the computer science concept of encapsulation while providing some modest amount of entertainment for those of you already in the know.
Ok, let’s begin. Today we make taco salad.
Here are some of the basic ingredients of a taco salad: Kale, tofu, tomatoes, and an avocado. These don’t represent the proportions of each item, just the items used. You also may be thinking at this point that this isn’t much like what you think of as a taco salad. You’re welcome to debate what is and is not a taco salad in the comments. I have computer science to teach.
This is the star ingredient. What looks a bit like I dipped an enormous tupperware in a rocky swamp outside my house is in fact a thickened bean soup! This bean soup I made earlier using parmesan cheese rinds, kale ribs (the part that’s left when you de-leaf the kale. They soften nicely in the soup), dried tomatoes, oil, salt, vegetable broth, and black beans stewed for five or so hours in a slow-cooker. The beautiful part is, though, all that matters is that it is a thickened bean soup. I believe that most thick bean soups will work well in this recipe, and so I don’t provide instructions to make bean soup, but encourage people to make whatever kind of thick bean soup they want and then try using it in this recipe.
The thickened bean soup (TBS for short) is encapsulated in that the recipe does not know or care about the details of how it is made. As long as it has the properties that it is bean-based and is a thickened soup, no other details matter very much. For more terminology we can say this recipe is independent of the recipe for creating the original TBS. If you’ve seen a recipe say to saute or broil something, this is similar. Even the steps involved in a saute involve abstraction of various complexities like what oil should I use, or how hot should I turn the stove? These themselves are based on prior knowledge such as how to make a stove hot or what is oil, and where do I get it? Because we humans have a shared cultural knowledge base, the entirety of our communication is based on these abstractions and assumptions.
In computer science it is much the same, except the first step of building a program is generally to manually construct these assumptions and give them to the computer. To build complex software we start by building simple programs, or functions, and combining those functions to make more complex functions, much like one combines knowledge of pans, oil, and stoves in a particular way to define saute. We can continue combining and becoming more and more abstract until the previously daunting software only takes a few lines of the functions we’ve been constructing. Obviously, it is possible to make a thick soup of beans that is absolutely revolting while still meeting the criteria set in this recipe, so encapsulation isn’t quite as clean in cooking as in programming, but the general notion is very similar. In any case, let’s continue.
Finely chop the onions. Cook them in oil until they are lightly browned. I like olive oil for this.
While the onions cook, chop tomatoes. They do not need to be finely chopped, as they will soften as they cook and can be mashed. It may be easier to mash them if you chop them more finely ahead of time, but that is up to you.
Tomatoes have a lot of liquid. The more of this you can steam away without burning anything too much, the denser and more flavorful your taco filling will be. Watery taco filling is not as bad in a taco salad as in a regular taco, but if the salad ends up unflavorful because you didn’t boil away enough water, you’ll have only yourself to blame.
Add some TBS! You’ll notice I threw in some cilantro, too, for color! If your filling is still looking watery, keep boiling it!
Next is the kale! I recommend washing and spinning it after removing the ribs (save them for soup!) You can do this while you’re boiling away the enormous amount of excess liquid in your taco filling from the fresh tomatoes. If you dump out the liquid, you’re dumping out the flavor as well, so it must be boiled!
Finally, place a little kale in the bottom of a bowl. You may want a large bowl for this. Throw on some cubed tofu, then add your taco filling. Add some cheese if you like. I like Cabot Creamery’s “Seriously” sharp cheddar. Avocados are a must for me, but I understand there exist people who do not like them, so add them or not according to taste. A dab of salsa on top makes for a nice flourish and if sufficiently spicy start your meal off with a kick. Serve promptly.
Everybody who makes this recipe, let me know in the comments what TBS you used and how it worked for you!