Blog  |   Puzzles  |   Books  |   About

Enigmas into pockets

A few times each year – once or twice a semester at Art Center, I get to explain to the uninitiated what a “variable” really is. Not the mysterious x from high school algebra, whose contents are unknown, and which we must decipher — even though there is no tangible reward! No, not an annoying mystery, but a comforting little pocket — one of many pockets, that we can put stuff in: quarters, gum, knives & marbles, for later retrieval.

I love introducing programming concepts to neophytes – it is why I teach. But I must admit, it’s a little daunting, and I’m not entirely successful at it. I figure at least half of my students are like the cook who learns to make a roux, but only uses it for the one dish for which it was initially required. They write down the recipes, but don’t really grasp the concepts.

But in each collection of the unilluminated, there are always a few “ahas”. And each time I hear an audible “aha!”, a thrill runs through me. I imagine the feeling is a little bit like the pleasure of converting the unsaved. Through the newly opened eyes of the convert, I see myself, years ago, when my own eyes were newly opened. I am young again, and feel the spark of new discovery.

I have transformed an enigma into a pocket.

3 Responses to “Enigmas into pockets”

  1. wuzziwug Says:

    Hey Jim – Good explanation! I’d be interested in whatever other analogies you use. For some reason I feel like I’ve yet to come up with a really good way of explaining JSON (since it’s both a way of transferring data and defining classes) that really conveys its extreme nifty-ness.

    Nice closing line. :)
    – pamela

  2. jbum Says:

    That particular analogy came to me last week while I was teaching. If I come up with a good one, I’ll keep using it. One I’ve been using for a few years is that functions are like the guy at the deli who takes your order. The name of the function is “make me a sandwich,” and then you supply parameters, like “pastrami”, “no mayo”, “extra pickle”.

    The reasons why JSON are necessary are arcane and rooted in historical accident, which make it a tough candidate for a simple analogy. In that particular case, I might simply demonstrate it, and compare the size (and time to parse) a JSON packet, versus comparable XML… I tend to find the big analogies more useful when preaching to lay audiences.

  3. jbum Says:

    Looking at the ads on the right, I see that the Google-bot can’t quite figure out what this page is about…