Hacker News new | ask | show | jobs
by crdrost 2599 days ago
I once was outlining notes for a course I would like to give introducing computer programming. The idea was to have exercise and theory sessions interleaved, which left the first session, which has to be theoretical in order to introduce the thing, kind of pointless.

So I wanted to explain kind of what programming is, and what it means, and I went to the etymology and why we call it what it is. And it turns out that the etymology tells you that it's a throwaway word. It comes from the same root as a program at a play -- it is just a schedule of what a computer will do, when. The hard concept is not "programming", the hard concept is "computer". Indeed our failure to so far resolve something like P = NP can be traced to our ambiguity on what exactly a computer is.

So I wondered what I would say to kids who had never programmed before and decided that I would just be honest and say that I don't know exactly how to define computers, but that in our experience we can say that they are machines which are at least good at a few things: Math, Art, Control, Graphs. Maybe I had one or two more, or maybe that was it.

This actually changed the course vision directly. Before I was doing what came natural to me as someone with a heavy mathematics education: let's do fibonaccis and factorials and primes. But that's wrong. If you want to teach programming then you want to hit all of these more evenly, not one of them heavily. And if you want one thing that hits all of them directly, you would ask people to start programming games. After all, what is a game? It is a user-Controlled walk-through-a-Graph whose nodes contain Art that rewards or punishes the user for how they walked through that graph. Possibly math exists in the form of, say, physics engines and drawing and such: but it is more of a means to add some interesting features rather than a purpose in itself.

So I had to go back and rewrite a bunch of the follow-up sessions and now it is not in a 90%-done state but in like a 40%-done state, heh.

But yeah, if computations are just what computers do, then the only obvious division between computation and programming -- which Wolfram may have intended -- is that programming languages typically have to focus hard on the sequence of what is going to happen; technically one might say a computational language is less about what order things happen in and more about what result is wanted. Logic languages might be more "computational" than functional languages which might be more "computational" than imperative languages, on this account. And indeed as one goes down that path one sees less and less symbolic representation of expressions and more concrete focus on data structures and values.

Possibly what one needs after that is a sense of metadata and metalanguage: in the language I specify what my conditions of adequacy are for what I am looking for; with some metalanguage I might be able to help a computer figure out one way to get there.

1 comments

I tend to think of the "programming" part as "planning", which I think fits the etymology. Planning is hard!