Tuesday, December 5, 2006

Concepts and Relationships

The Cognitive Dimensions of Notation vocabulary calls what I'll discuss here "closeness of mapping". Translation between programmer thought and program notation is difficult. Less required translation is better. So strive to allow the human to express his/her concepts as close as possible to his/her natural way.

What is the natural way we represent concepts? To answer intelligently I'd have to be a psycologist. But I'm pretty sure that any code is not natural. It becomes second-nature to skilled programmers, but only after extensive training, such that us programmers can think directly in the concepts and even language of certain types of computer code.

First observation: we don't express all our concepts the same way. Yes, eventually everything gets stored as connections and signals between neurons, but I don't interact with my concepts that way, or at least I don't try to explain them that way. To explain a mathematical concept, I may lead you through a bunch of symbols and equations. But if you didn't know what the word "mother" meant, I'd try to explain it in much different ways. Perhaps I could express it as symbols and equations, but I'm not sure that would help you.

So on the micro-scale, there is no one optimal language. In other words, tagline 2: "The solution to the problem of programming is not to develop another programming language." In fact, for the low-level nuts-and-bolts, the languages we have are quite good. (Low- and medium- level languages are coupled with hardware capabilities, so as long as hardware stays basically the same, so does the language. I may bring up some alternate ways of doing hardware, now that parallel is hot, that make us re-think these low-level concepts like sequential execution.) Instead, we need to develop a programming environment in which normal humans can work with concepts and relationships in natural ways and eventually--eventually!--put together code.

Second observation: we care a lot about relationships between our concepts. In some schools of thought, concepts themselves are meaningless; only the interactions between concepts (and between concepts and the real world) are meaningful. For a current example of the stress on relationships, see object-oriented programming. But does "object" equal "concept", and "public interface" equal "interaction"? Yes, in some cases. Aspect-oriented programming is trying to capture the rest of the cases. But both paradigms dip shallowly into the richness of our concepts and their interactions, imposing strictness of hierarchy and syntax. [Interaction-oriented(?) programming is taking the first conceptual steps in the right direction here.] An object IS_A concept. So is an aspect, feature, interaction, whatever else we have these days. Let's just do what we always do when we see regularlity like this: generalize it. It seems that a relationship between concepts is itself a concept, or perhaps the instance of one. Oh, instantiation is a concept too. This is all a bit worrying from the where-do-you-stop point of view, but philosophy has the same problem.

Third observation: Our representations of concepts evolve. We often subconsciously refine how we understand things and communicate them.

I'm going to go ahead and post this, even though it's not really done.

Next: Rigidity, Corner Cases, and Syntax

~Ken

No comments: