- inspiration for jaded coders
- speculative ramblings on software development
This site hopes to muse and amuse, to inspire and conspire, and to ruminate and illuminate on the subject of programming as poetry.

Saturday, March 17, 2007

Stepwise Refinement

Khan's Koan

In the days when Khan was studying at ETH,he was hacking at a terminal when Wirth happened by."What are you doing?" Wirth asked him."I'm teaching the computer to think," Khan replied.Wirth reached behind the terminal and unplugged it.He placed a large blank sheet of paper in front of Kahn,saying, "First teach the paper to think."At that moment Khan was enlightened.

Programming is usually taught by examples. Experience shows that the success of a programming course critically depends on the choice of these examples. Unfortunately, they are too often selected with the prime intent to demonstrate what a computer can do. Instead, a main criterion for selection should be their suitability to exhibit certain widely applicable techniques. Furthermore, examples of programs are commonly presented as finished "products" followed by explanations of their purpose and their linguistic details. But active programming consists of the design of new programs, rather than contemplation of old programs. As a consequence of these teaching methods, the student obtains the impression that programming consists mainly of mastering a language (with all the peculiarities and intricacies so abundant in modern PL's) and relying on one's intuition to somehow transform ideas into finished programs. Clearly, programming courses should teach methods of design and construction, and the selected examples should be such that a gradual development can be nicely demonstrated.

As computing professionals, it is our duty to speak up against a culture that equates computer literacy with mastering the intricacies of a production programming language.

This reminds me of E. W. Dijkstra’s tale of his worst night after reading the specifications of the new programming language PL/1 in 1965. He said he had the painful vision that in the future programming will be equated with learning PL/1, and computer science with mastering OS/360 JCL. Replace PL/1 by C++ or Java, and JCL by Windows or Linux, and you are miraculously transposed into the present time.