Drawing enlightening parallels between computer science and bacon

My housemate has become rather obsessed with bacon in recent days. He’s been reading the Bacon Subreddit religiously and filling me in on all of the breaking news and happenings in the burgeoning online bacon community. This past weekend, the bacon fever reached critical levels, because he went to the grocery store, bought a lot of bacon, and started cooking it. This was a big step for him, trust me.

So the first time he made the bacon he put some olive oil in the pan first (I know, bacon purists are wincing at the travesty). But by the time the bacon was well underway, it had already made so much of its own grease to cook in that the puny amount of olive oil was proven completely unnecessary. Bacon thus contains everything within it necessary to cook it. How amazing is that? So the second time he made bacon, he didn’t bother with oil. He just turned the heat down at the beginning while the bacon was generating its own grease (so as to not burn it), then it was off to the races.

In other words, to borrow a term from computer science, bacon is self-hosting. Much like how the compilers of mature programming languages are written in the language they compile, bacon produces all of the greases necessary to cook itself. Bacon isn’t just scrumptious, it’s a smart choice.

But that’s not only the comparison that can be drawn to computer science. Bacon can also bootstrap other bacon. Too impatient to wait for bacon to generate its own grease to cook in? Just save up the bacon grease from the previous bacon cooking session in a Tupperware container and use it to jump-start the next batch. The parallels here with using an already-compiled compiler executable to compile the first compiler on a new system are uncanny, are they not?

I’m sure there are lots more analogies to be drawn between bacon and computer science, and I’d love to see them fleshed out in the comments below. In fact, bacon would make a great standard analogy to be used in introductory computer science classes, alongside Alice and Bob and “think of your computer as an automobile”. Not only is this a great idea because bacon is easily understood by everyone, but also because it’s delicious.

Comments are closed.