Computational Rhetoric

Building on the discussion over in InterfacesShouldBeAdjectives. When you do that (name interfaces as adjectives), you are creating a form of computational rhetoric. I got to this place from considering language as a metaphoric base for programming.

As opposed to trying to parse natural language for programming, let us understand the power and leverage we get from using the mechanisms we have created over millennia for natural language, and see what of those mechanisms we can apply to improve the expressiveness of programming.

The whole thing with natural language was interesting because it raised my expectations of programming languages - why can't we have natural, easy-to-use, dynamic classification and multiple inheritance, use of roles, etc. - we use that kind of thing daily to speak? And where are our uses for quiet tone of voice, shouting and the like? When we sort this out, we'll have what I call ComputationalRhetoric.

Every programming language is an example of computational rhetoric, albeit impoverished. Computational rhetoric requires three parts:

Predictable is a questionable word to use with respect to large programs, but some flavor of predictable effect is what we are after in computational rhetoric. If you jump up and down in front of your computer and scream "Stop! You *&^@# program!", that is not computational rhetoric (except as a null operator). But if you pull the plug, that is computational rhetoric.

So I would like the power of adjectives, adverbs, role-playing nouns, shouting, pleading, etc. How about a program along the line of (pardon the monotonous tone of voice in what follows)

  if checkAmount > $1000000 and checkAmount > balance
     then begin
         REALLY, REALLY BAD IDEA!!
         take some actions
     end
-- AlistairCockburn


Have you read DonaldKnuth's LiterateProgramming? It appears to me as if you're talking about the same sort of idea. Knuth's premise is that you should write programs not only to accomplish a task, but to communicate with the future programmers who will be reading them.

-- KatyMulvey


Knuth targets literate programming as two languages for two audiences... english (or prose) to the programmer, and compiler statements to the compiler. I am targeting Computational Rhetoric as one language for two audiences... the programmer has access to whatever constructs the compiler writer invented.

Every compiler defines a computational rhetoric. So that is not new. Just most of them are pretty impoverished. MixIns and InterfaceInheritance begin to give us access to the power of adjectives as we already know and use them.

I would not aspire to say that programs written with a more powerful compuatational rhetoric are easier to understand (that is not the target group) - just as I would not aspire to say that prose written in more powerful natural language are easier to understand (we have all seen convoluted prose). I would say that writing programs with a more powerful computational rhetoric makes it easier for the programmer to express what she-he has in mind.

AspectOrientedProgramming picks up one aspect of this. In AOP you can say something like,

  Do this
  (and do it QUICKLY, or TINY-LY, or whatever)
and the compiler selects the implementation that suits the adverb.

-- AlistairCockburn


EditText of this page (last edited April 29, 2005) or FindPage with title or text search