Object Oriented Pie

There will be pie in this post, but if the saying is “you’re going to have to sing for your supper” then you’ll definitely need to learn for your desserts. Still if you just want the recipe, scroll down to the bottom.

The other day I learned I was going to be TA-ing my school’s Intro to Computer Science class (so did Ashok for that matter, but I’ll let him talk about his own experiences with it).  To understand why this is as  exciting for me as it is involves a little back story as well as a familiarity with the phrase “the wand choses the wizard, Mr. Potter”.  Coming into college, I was not overly pleased with the fact that I needed to take another math credit to graduate.  I came in undecided but very firmly planted in the arts and humanities side of campus.  Still, it had to be done so I put on my big girl pants and signed up for the least math related math class I could find: Intro to Computer Science.  To my surprise, I enjoyed myself.  I enjoyed myself so much I’m still taking CS classes.  Now, it’s my major.

None of that would have happened if I hadn’t had such fun in my first class, and now I get to bring that to others!  I know it sounds sappy, but that’s the best way I can express it.


Or more correctly, the learning before your pie.  So I was practicing my TA-ing skills by teaching a friend of mine the basics of Java programming.  If you’re learning programming for the first time a lot of scary computer-sounding words are thrown around.  The phrase “Object oriented language” for example went entirely over my head when first learning how to code.  Explaining what classes and main methods are can be incredibly difficult for those with no experience with code.

Fortunately, I came up with an excellent metaphor: pie.  Yes, along with being the oldest slapstick concept (besides the banana peel) in the book, along with being one of my favorite things to cook, pie can explain the basics of Java programming.

Just go with me on this.

One morning you wake up with a desperate craving for some pie, so you walk to your kitchen and realize you have everything to make pie!  Yay for you!

The first thing you need when making pie (even more important than pie crust) is a place to make pie.  Conveniently you have a counter to mix ingredients on.  This is essentially a class in programming.  It’s a space to create whatever you like.  Without it, you’re just not going to have any pie…or code.

However, you don’t actually mix your ingredients on the counter.  That would make a mess.  Your crust dough would get all mixed with the filling even before it was baked!  Instead you get the mixing bowls out and place them on the counter to put your ingredients in.  This is what is called a method in coding.  You can have a great deal of them, each performing its own task, but all on your counter.  If you think of your ingredients as variables, the place that these variables mingle with each other is the bowl.  This is where the making of your pie actually happens.

Finally, you can mix all of the things you’ll need to make pie in their mixing bowls, but it’s not pie until you put it together.  This is what’s called a main method and is your pie plate. You’ll always need it for making pie.  You won’t have pie unless you have some vessel to combine crust and filling.  It’s the place where your methods come together to create your output.  It’s also what your user interfaces with.

Make sense?  If not, please leave a comment.  I’m going to be teaching this stuff soon and I need this to be clear.

Now for your pie!  It’s over 100 degrees today, so we’re not going to use the oven.  This is a variant on Alton Brown’s Moo-Less Chocolate Pie recipe.

Yes, it does involve tofu BUT before you get angry at me for luring you in with the promise of baked goods and then giving you tofu, trust me when I say you won’t notice it.  I’ve fed this to younger children who thought tofu was a synonym for “icky soybean barf”.  I’ve fed it to carnivores, herbivores, and chocoholics alike and everyone has given me stellar reviews.



  1. 1 12 oz package chocolate chips(Although the chocolate police aren’t going to come if you add more.  Just add a proportionate amount of liquids as well)
  2. 1/3 of a cup of liquor of your choice.  (I like coffee, hazelnut and peppermint.  I don’t recommend anything with a lot of alcohol-ey taste.  You’ll notice it if you put spiced rum in this pie.  Alternately, if alcohol is not at your disposal, use espresso, or half and half or something.  Use bouillon if you like, this is primarily for flavor and I’m not one to judge)
  3. 1/4 teaspoon of kosher salt
  4. 1 teaspoon vanilla
  5. 1 package firm pressed tofu, drained
  6. 1/2 cup creamy peanut butter
  7. 1 chocolate cookie crust
  1. In a double boiler melt the chocolate with the liquid of your choice, salt, and vanilla.
  2. In a food processor, combine the tofu and peanut butter until homogeneous.
  3. When melted, remove the chocolate from the heat and give it a few minutes to cool.  Then, pour it into the food processor with the tofu and peanut butter.
  4. Combine completely and pour it into the crust.
  5. Refrigerate for an hour and a half (although it’s good as it is).
  6. Top with whatever you like best on your pie.  I’m personally fond of cool whip, strawberries, and a bit of grated chocolate.  Still it’d be really good with finely sliced mint and basil leaves or a bit of cayenne pepper.  Really, if it goes well with chocolate it’d probably go well with this pie.
  7. Eat it quickly!  I’ve never had this pie last more than 24 hours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s