Saturday, April 5

The meaning of code

I had an "Aha!" moment today when I came to a Wittgensteinian realization that while the sense of a piece of code corresponds to the formal behaviour of that code, the meaning of the snippet is the set of possible contexts where this code could be used. This idea has changed my view of teaching programming (I have been teaching Python in a local school for a couple months now).

This attitude is nothing new, but for some reason I have not come across it, or rather, I have never seen it applied. (The fashionable problem-based learning thing has some similarities, but isn't quite it.) Having an idea to start from, it was not hard to find good articles expanding the idea. I especially liked Robert Strandh's short writeup on idioms and Elliot Soloway's Learning To Program = Learning To Construct Mechanisms And Explanations (1986). Experienced programmers will not learn much, but anyone dealing with CS education, teachers and students alike, ought to have a look.

The moral is that emphasis should be placed on reading exemplary code ("experienced programmers do X this way") rather than definitions ("function Y does Z"). Programming seems to be closer to language use than to mathematics, and teaching methods should reflect that.


dburrows said...

I was following along until you said that programming is more like language use than like mathematics. I'm not a mathematician (nor do I play one on TV) but it always seemed to me like language use was tremendously important in mathematics! Yes, mathematicians sling symbols around, but those symbols form a language, and moreover they're usually accompanied by more than their weight in natural language, explaining WTF the symbols are supposed to mean.

Personally, I think that I write my best (and best-commented and best-documented) computer code when I'm thinking of it as a mathematical proof and my worst when I'm thinking about it as a set of instructions for a computer. YMMV.

caiyan said...

yeezy boost
yeezy boost
michael kors handbags
mont blanc pens
michael kors outlet online
michael kors outlet
michael kors outlet
fitflops uk
ray ban sunglasses
michael kors handbags