[plt-scheme] Perplexed Programmers

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Aug 31 11:06:25 EDT 2007

On Aug 30, 2007, at 1:50 PM, Geoffrey S. Knauth wrote:

> The Design Recipe gives us templates in the design process, such  
> that programs nearly write themselves.  Can we make a library of  
> structure and algorithm templates for DrScheme that can be called  
> up at the press of a button?

Absolutely. And it would be a disaster for beginning students. We  
knew this in 1995 and we had a request for that in 1996 from a  
colleague at Rice. He was in graphics and came from the Fortran  
compiler community. Code was code.

The point of the design recipe is for students to get into the  
structural part of programming -- be that for method dispatch in  
Java  or recursion in Scheme. When they have absorbed it to the point  
where it is second nature, we show them abstraction .. indeed, I  
usually wait for them to ask for abstraction. ("We have written this  
code so many times now. Isn't there an easier way to do this?" A: "I  
am glad you asked.")

There is a section that didn't make it into the book to the extent I  
have taught it:

  pre-emptive abstractions from templates.

You could have them look at the templates for

    StructuralData -> ???

and introduce extra parameters for combing the results and creating  
default answers. After watching things in classrooms from elite  
schools like Rice to urban schools in Houston, I have come to the  
conclusion that for the vast majority of students, it is better to  
abstract from concrete examples instead. Once they do this very often  
and IT becomes second nature, too, you might consider providing code  
wizards or higher-order libraries (say polytypic stuff). Until then,  
drill and bet on bottom-up learning the systematic nature of design.

-- Matthias

Posted on the users mailing list.