Monday, February 2, 2015

functions

I've been thinking a lot about how to explain functions and programming to non-programmers.  Functions are a bit like toasters: you put something in (the bread, maybe a setting for darkness on the toast), press a lever, and wallah!  Out comes toast.  It doesn't really matter what the exact details are about how the toaster works; it can be a black box where all you need is to know what comes in and what comes out, and then you can incorporate that black box into your workflow of making, say, a fried-egg breakfast sandwich.  You can replace one toaster (the regular upright kind that takes two slices) with a different kind of toaster (like a toaster over), but still, all you really need to know is that bread goes in and toast comes out. 

Yesterday I made French toast with a friend.  As the pieces sizzled on the griddle, I absentmindly asked him - having these musings in the back of my mind - "Can I have a plate for the output, please?"

"You are such a geek!" he teased me, handing me a plate.

The French toast was good.  The joke was better.  The realization that I've been too long in graduate school... priceless.

No comments:

Post a Comment