Programming without math, part 10

One thing that is becoming clear to me, as I play around with different implementations, is that universal programming literacy will require undoing the general perception of programming as an “off-line” activity — as opposed to, say, writing, which can easily function as an “on-line” activity.

By “off-line”, I mean something you can generally only do slowly and in solitude, when nobody else is around to disturb your concentration. It is certainly true that much writing of prose takes place off-line. I generally write these blog posts during some interstitial time of day, when no one else is about. On the other hand, we don’t need to write off-line. It is quite common now for people to engage in text chats or fire off quick emails in the middle of events or meetings. And of course the entire point of a tweet is that it is an emphatically on-line act. In fact, this single quality essentially defines the very ethos of the twitterati. To tweet is to twist the dictum of Ram Dass — “Be Here Now” — into an imperative to “Be There Now”.

And so I’ve reached the conclusion (at least for now) that the proper way to teach programming — if programming is to be a universally acquired skill — is to immerse the learner into an on-line community, via a synchronously shared game or activity, in which programming serves as a fundamentally conversational skill. In such a learning environment, communication between people should be an essential purpose of the act of programming.

In this scenario, programs are not heavy things, like most programs of today — creations of psychic bricks and mortar — but rather light and airy, quickly mutable, jotted musings that produce an instantaneous effect, which can be quickly changed and just as quickly discarded.

In other words, the very qualities that we expect from a language.

A fifth of vodka

Today I was visiting the MIT Media Lab, mainly to talk with Mitch Resnick and Marvin Minsky about programming without math. While I was there, I got a demo from a grad student about a multitouch table interface he’s been developing. He told me he’d discovered that the simpler he made his interfaces, the more people seemed to like them. We discussed the need for very natural interfaces that make the most intuitive sense to people. Even if such interfaces have less functionality than the fanciest interfaces, people greatly prefer them.

At one point in the conversation I found myself saying that interfaces should pass the fifth of vodka test. “What’s that?” the student asked. I explained that the best interfaces are the ones that would still work after the user has drunk an entire fifth of vodka. The student seemed somewhat surprised to hear of such a thing, but he agreed that this is indeed an excellent test, one that seems to get at the essence of things. For example, the Apple iPhone passes with flying colors, whereas it’s hard to think of any software by Microsoft that would pass the fifth of vodka test.

So how long had this test been around? Well actually it hadn’t — I just made it up that moment. Still, I think there’s something to it. For example, it could be interesting to see how well the fifth of vodka test works in practice. Then again, I can foresee some practical problems. For one thing, I imagine it would be very difficult for a study validating such a test to get funding from the National Science Foundation.

If you see what I mean.

In her own write

We generally don’t realize where the rules are, until we see them broken. Everything we do — dining at a restaurant, riding a bus, attending a seminar, going on vacation at the beach, writing a book review — has a host of unwritten regulations, specifications, agreed-upon limitations. These rules are enforced by society at large in a host of ways. Most of these ways are so deeply engrained, so endemic to the DNA of our experience, that we don’t even realize the rules are there.

Until they are broken.

Yesterday I experienced a glorious breaking of the rules of writing a book review. In a rare — and as far as I know unique — departure, The New York Times Sunday Book Review accepted a piece by the great young singer/songwriter Nelly McKay which was itself a work of transgressive art. In all my years reading the NYTSBR I’ve never seen anything like it, and I must say I was impressed and delighted.

The context was songwriter/musicians reviewing biographies of songwriter/musicians. On one page appeared Nelly McKay’s review of a recent biography of John Lennon, and on the very next page appeared Suzanne Vega’s review of a recent biography of Paul McCartney. So far, so good — matched sets.

But Nelly McKay, apparently discontent with this prosaic formalism, chose to think outside of the box. Hell, she did away with the box altogether. Taking a cue from Lennon’s linguistically plastic 1964 book “In his Own Write”, she turned in an original work of surrealist art.

Which the editors, to their great and eternal credit, published as is. The result does far greater honor to the spirit of John Lennon than ever could be achieved by any mere book review.

But why take my word for it? You can read it for yourself.

When snow falls in New York

When snow falls in New York it fills the day
The cold air snaps in perfect crystal light
Manhattanites all wander out to play
Forgetting to be chic in their delight

The park is lovely in its winter best
Dappled by a sea of hats and gloves
Couples dart about as if possessed
Flinging snowballs at their winter loves

One day soon we’ll come back to our wits
And again be jaded, ever in the know
We’ll put away the scarf and winter mitts
But today we’re all just kids who play in snow

Literature

Circling around the topic of programming without math — but not quite landing back there yet — I remember a very evocative conversation I had with Marvin Minsky up at MIT about five and a half years ago. We got onto this very topic – the question of whether there would ever be such a thing as universal programming. To put this into some context, Marvin is not only one of the founding gods of the field of artificial intelligence, he was also a key mentor for Terry Winograd back when Terry was doing his SHRDLU work. So Marvin’s interest in such subjects goes back to the very beginnings of the era of modern computers.

I asked him whether there could be a computer programming language learnable by all. Marvin’s response was unique, and rather profound. He said “Computer science already has a grammar. What it needs is a literature.”

There are a lot of implications nestled within this response. When I think of a “literature”, I think of the fact that we all enjoy reading what each other has written. We read Jane Austin, Woody Allen, Stephen King or Alice Munro for fun. It’s not work, it’s enjoyment. If I write a prose piece and nobody ever wants to read it, then on some fundamental level I have failed.

When we talk about computer programming the situation is not so simple, because there are two artifacts: the computer program itself, and the resulting runnable program. In today’s world, most people who play around with a program you’ve written will never look at your code.

Marvin’s response suggests the possibility of a different relationship between the written program and the user’s experience — one in which program and experience are not kept separate, but rather are intertwined with each other. If we look at the user as a reader — analogous to the way we think of the reader of a novel — then we want the user to be aware of the written program, with sufficient literacy to be able to appreciate, and even critically comment upon, the author’s process.

Of course this is very different from the world of computer programming as it exists today. But I think Marvin is right: In order to truly enjoy a medium on a cultural level, we all need to be able to appreciate the beauty within the process of creating the work, not just within the final result. Whether it be dance, music, architecture or the novel, we learn to fully appreciate art only when we understand something of how it was made.

And so it will be when the ability to program expands beyond the realm of math/science and becomes a universally accepted mode of cultural production. When that happens, we will be able to read each other’s programs with a casual facility that will simply be taken for granted. And then programming will be on its way to developing a literature.

The nature of empowerment

Today I met with somebody who told me that he has been following my posts about “programming without math”. He expressed surprise when he found out that the images I showed in part 7 (my post of Dec 11) were from an actual implementation. Yes, I’ve been busily coding this stuff, making a real system, with snap-together code tiles, and I’ve been playing with that system. It hadn’t occurred to me that people wouldn’t realize that it’s real (or at least as “real” as mere computer software can ever be).

Of course there is an irony in the way I’ve been doing this. I’m promoting this idea of empowering people by giving them a way to program without requiring them to first learn mathematical modeling. But in order to build a system that lets them do all this — in order to create the underlying capability — I myself am certainly using mathematical modeling. This goes back to the point that Douglas made several weeks ago. Somebody, somewhere in the programming ecosystem, needs to do the plumbing, run the electrical wires, build the chairs to sit on and the bricks and mortar of cyber-capability. There’s no way around it — somebody has to have these specialized skills.

But that doesn’t negate the fact that everyone else could have a lot more power than they do now, without needing all of those specialized skills that I use to build a system like the one I showed snapshot of on Dec 11. And of course it would be nice, as long as people are getting hooked on the power of programming, if some of those people would decide to dive down deep and also learn the kinds of mathematical skills that I, and people like me, use to build the underlying infrastructure.

Empowerment doesn’t come all at once. It comes one step at a time.

Guest movie review

Now that I’ve gone over the major ideas, I’m going to space out the “programming without math” posts to a more infrequent schedule. As I implement things, I’ll post updates here so you can play with them for yourself.

Meanwhile, I wrote my first on-line guest movie review. How exciting!! I’m not sure that it’s exactly what they were looking for when they asked me to write a movie review, but it sure was fun to write. It appears as the December 17 post at smex.me.

Oh, what the heck. I’ll just reprint it here:


I was in Europe because I had taken part in a forum on public policy, which started in Stockholm and then proceeded by train to Oslo so we could see the Nobel Peace Prize concert — the one that honored our president. I’m from New York, which is almost the same as being from the U.S. — one of the major differences being that we actually like this president, which I am told makes us more like Europeans.

The public forum in Stockholm was great because we got to hear all of the policy experts from the U.S. and Great Britain get up, one after another, and talk about what fabulous and perfect jobs they are doing. I can tell you that it was a great relief to hear that these people are all doing fabulous and perfect jobs, and I wanted to share that with you, in case you had been harboring any doubts.

The Nobel Peace Prize concert was fascinating, partly because Obama wasn’t, well, actually there, which made the whole thing really funny and surreal. Everyone was congratulating him, smiling like crazy and telling him what a great guy he was, whereas, in truth, Elvis had left the building — the birthday boy had flown back to Washington that morning, not even staying long enough for a nice lunch with the King.

This level of contradiction seemed to suit the occasion perfectly, since Barack Obama’s acceptance speech for having just won the Nobel Peace Prize was a forceful and rather intense declaration that the United States of America has the right to wage war on Afghanistan or any other darned country, if it thinks that’s the right thing to do. I’m not really sure how well any of that went down in Oslo, but I’ll bet it went over great in Nebraska. Although I’m not really sure anybody in Nebraska was listening.

All of which leads to “In the Loop”, which rather appropriately is about the people in the U.S. and British governments who set public policy about whether to go to war. I felt eminently qualified to enjoy this film, after all the inspirational talks I’d attended in Stockholm. Although, as it turned out, those talks really didn’t prepare me for this movie. But more on that later.

I was told by my friends Manuela and Gerald about this lovely tradition of Opera employees, or former Opera employees, or FOEs (friends of Opera employees), seeing an English language movie every Sunday evening, after which somebody gets volunteered to write a review about the experience. In this case that somebody turned out to be me. My fellow friends and FOEs took great pains to instruct me that the review doesn’t actually need to be just about the movie, and you can see that I have taken those instructions to heart.

Even before the movie started the stage had been set. We all met in a pub for a pre-film pint. When I first got there the only other person was a really nice chap from England. I asked him what were the good beers here. At which point the man’s face assumed an expression of exquisite sadness, and with a mournful air my new friend gently explained to me that there are only four types of beer in all of Norway. I took in the enormity of this statement, and in that moment we, the New Yorker and the man from London, formed a bond of common tragedy, a shared understanding of the infinitely sad absurdity of existence.

Which was a perfect lead in to the movie. For it turns out that if “In the Loop” bears any relationship to reality, then all of those nice policy wonks giving speeches in Stockholm had been lying through their teeth. Like just about any decent British comedy, this film presents such a dark and thoroughly dystopian view of the world, such a depth of pervasive cynicism and despair about all received truths and deeply cherished childhood ideals, that to sit through it is to watch your very faith in the world melt away like a chocolate easter bunny in hell.

Which is to say that it is a very, very funny movie. Brilliant writing, wonderful editing, fantastic level of ensemble acting across the board. As we sat there in the little Oslo theater, watching the realization of every most deeply held fear about the sheer incompetence and venality of the people who work in government and make life-or-death decisions about whether or not to go to war, we were laughing our heads off at one insanely clever line of dialog after another. By the end credits there wasn’t a dry seat in the house.

See it, it’s fun. You’ll have a nice time.

Stories, coming and going

Anyone who has ever spent time with a two year old knows that they love to hear stories over and over again. Give them a Disney film and a start button on the DVD player, and they will gladly watch that film two hundred times or more. They will stare at the screen in rapt attention, singing along with all the songs, oblivious to the world around them. And they will enjoy that film just as much the two hundredth time as they did the first twenty times.

At some point we outgrow this. Oh, sure, occasionally we will see a film more than once, maybe even three times, but our days of watching the same film — or hearing the same story — dozens of times or more eventually fade out and leave us, as we gradually emerge from Neverland and take our place in the world of school, and then dating, and then adulthood, somewhere along the way losing that magical ability to derive unbounded pleasure from endless repetition of a single story.

But eventually a funny thing happens. As people approach later life, they begin to tell the same stories multiple times. A tale first heard perhaps fifty years ago seems new again, as though it had first been told only yesterday. The story queues up, fresh and eager, like a new memory.

Many of us have an older grandmother or grandfather — or perhaps an elderly great aunt or great uncle — who revel in the tales they tell, even the tenth or fiftieth or two hundredth time they’ve told the same story to the same listeners.

Perhaps it’s all part of the same great circle. When we are vey young we have a voracious appetite for hearing the same story, and when we are very old we have a voracious appetite for telling them.

Maybe this part of life that is in the middle, this long period of adolescence leading to adulthood, is merely a diversion, a temporary loss of innocence, a time when our grown-up mind can only give or take our cherished stories in fits and starts, no more than one time to a customer.

There are many pleasures to be had by those of us in the vast middle. But the joy of a story endlessly repeated remains the provenance of only the very young and the very old.

Programming without math, part 9

There are concepts described easily in normal English conversation that are rather more difficult to describe in computer languages. For example, when we say “the block is red”, or “the block is blue”, it is understood that “red” and “blue” are mutually exclusive. Therefore if we say “the block is red and blue” then it is understood that the block must be painted with some pattern — red in some places and blue in others. Yet if we say “the block is tall and blue”, there is no such conflict — the block can indeed be blue all over, no matter how tall or short it is.

This works because we’ve come to the conversation with an elaborate set of prior understandings. We know the concept of color, and therefore that red and blue must be mutually exclusive. In programming parlance, we are bringing with us a rich library of properties that everyone in the conversation shares.

Generally speaking, programmers have a much clunkier way to describe the same thing. Concepts like “red is the ‘color’, of something” tend to be spelled out right there in the statement, rather than relying too much on prior understandings of what everything means. So, for example, we would explicitly say “the color of the block is blue”, rather than just “the block is blue”. I think this is one of the things that makes programming difficult for most people to learn. They are expecting the computer to know what they mean when they say something is red, rather than having to explicitly say that the color of that thing is red.

So it seems that if we want to teach programming in a natural way to people who aren’t already versed in the ways of programming, we need to build in some of these intuitive ideas about properties. We need to be able to say things like “red, blue, yellow and green are colors”, and then be free to ignore the word “color” entirely when we say something is red or blue.

Another thing we do in natural language, without really thinking about it, is to casually talk about entire sets of things. We don’t really think about this, we just do it. When you say “pick up a box and hand it to me”, you are really talking about a number of things. You are asking somebody to consider the entire set of boxes — presumably the boxes that are in reach of the other person. Then you are asking that person to randomly choose one of those boxes. It feels like you were just talking about one object, but in fact you were doing something much more complex. It doesn’t seem complex only because we are so used to these sorts of constructions — we are so good at them — that they completely fly below our radar.

So the question comes up: how much of that kind of implicit wisdom should be built into programming languages to make those languages accessible to everyone? I’d be curious to know if anyone has any thoughts about this.