Talk:BASIC in Print and in Memory
From Maze
Michael's Comments on Programming Plans
In the psychology of programming literature, an important concept is the code plan. These are abstract plans for code constructs that are realized into different constructs for different languages. Eliot Solloway did alot of the earlier work on code plans. In contrast to the Raven work you cite about domains (memorization involves connection/correspondance to a real world domain), the code plan literature talks about both program production and comprehension in terms of these abstract plans. This is applicable to one line programs (there's an infinite loop operating, etc.) and doesn't suffer from the "what is the domain of expressive computing" problem. Not sure how far you'd want to go down this path, but pointing out that there are much more sophisticated cognitive accounts of programming than the ones you cite.
My masters thesis in 1992 involved the implementation of a dynamic code documentation system (The Intelligent Code Object Planner) in which the system automatically generated example code snippets for using a particular API based on natural language queries. It had a formal model (frame representation) of the API - the NLU system (modeled on what Winograd did for shrdlu) turned NL queries into programming goals, specialized planning reasoned over the frame-based knowledge base to devise an abstract plan for accomplishing the query, and a unification grammar turned the abstract plan into concrete code in a specific language. The API the system knew about was a subset of Windows 3.0 and the concrete language it could realize snippets for was C. So you could ask things like "How do you draw an icon" or "How do you close a window" or "How do you get a handle to widget" and it would dynamically generate a code snippet in C showing you how to do it (including non-contiguous code). Anyway, it was in the context of building this system that I became very familiar with the cognitive science accounts of programming competence (circa 1990).
Here's a nice bibliography of work on psychology of programming, with many references to programming plans (as they are the dominant account of program comprehension and production): http://www.cise.ufl.edu/research/ParallelPatterns/PatternLanguage/Background/Psychology/Psych-bibliography.htm.
Michael, this is good to know and we'll want to mention the existence of more sophisticated models if that paragraph on Ruven stays in. (It doesn't really speak to the core of this section, but it seemed like an interesting opportunity to point out how 10 PRINT is an outlier and how theories about industrial programming don't apply to it.) But the main discussion here is about the memorization of programs. Do any of these papers deal with that? I didn't see from the annotations in the bibliography that they do. -Nick
