Wednesday, March 12, 2003

Programming Languages and the Whorfian Hypothesis

Along with Paul Feyerabend, another important 20th century relativist is a linguist named Benjamin Whorf. Whorf is best known for his part in framing the Whorfian Hypothesis (also known as the Sapir-Whorf Hypothesis, to give credit to his graduate advisor.) Briefly, the Whorfian hypothesis is that language is determinist: your language determines the way in which you think. So if, for example, your language has no way of expressing time (as he (falsely) believed of Hopi), then you would be unable to generate a conceptualization of time.

Generally, this hypothesis is believed to be false, at least in its strong sense. Obviously, there are weak senses in which it may be true. I especially recommend George Lakoff's book Women, Fire, and Dangerous Things and its discussion on Whorf.

But the point here is not about natural languages, but programming languages. From my own personal experience, I'd insist that, in fact, the Whorfian Hypothesis is true in a strong sense. When I learned Prolog, I was a terrible Prolog programmer as long as I kept thinking in terms of traditional structured programming. For example, to add up the values of a list of integers, I would conceptualize the task as an iteration. It was not until I (fairly suddenly) began thinking in Prolog that I could conceptualize the task properly.

The various conceptual models of different languages: functional, structured, logic, object, etc. all impose (or require) vastly different conceptual systems. In this sense, C++, C#, and Java are all essentially the identical language. In fact, that structured+object conceptual model seems to be the only game out there these days. It would be nice if there were a wider variety of languages available, ones that unlocked our brains from just a single way of thinking.