StrandsOfTruth

 

Richard O'Keefe in The Craft of Prolog writes:

If I may intrude a personal element here, one of the things which distinguishes imperative programming in C, Pascal, Fortran, or whatever from declarative programming in Prolog, Scheme, ML, or whatever for me is a big difference in feeling. When I code in C, I feel that I'm on a knife-edge of "state" — I focus on statements and what they do. I'm worried about the behaviour of a machine. But when I'm writing Prolog, the predicates feel like geometric objects and the data flow between goals feels like lines of tension holding the goals together into an integrated whole, as if the program fragment I was working were a large Rubik's cube that I could handle and move from one configuration to another without destroying it. When I fix mistakes in a Prolog program, I look for flaws in the static "spatial" configuration of the program; a mistake feels like a snapped thread in a cobweb, and I feel regret for wounding the form. When I'm coding C, I worry about "register" declarations and pointer arithmetic. When I'm coding Prolog, I worry about getting the interface of each predicate just right so that it means something and has the visible perfection of a new leaf.

Lovely images, which bring to mind the lines of force which reputedly helped Maxwell derive his equations, or the subtle threads which form the essence of magical power in some fantasy stories. Perhaps O'Keefe has also fingered one of the key differences between art and mass production, between mathematics and mere computation, or between beauty and crass manipulation. It's all about caring: the importance of every detail combined with the overall rightness of a structure. In a word, meaning. And it applies not just to programming, but throughout life.

(See also ResolutionAndUnification", ^zhurnal entry of 11 November 1999, for some other ^z musings on the theme of Prolog.)

Thursday, November 02, 2000 at 05:58:55 (EST) = 2000-11-02

TopicProgramming - TopicThinking


(correlates: GrayGreenGap, OnGrace, Comments on YouAreBetter, ...)

2 persons liked this