[racket] Using separate files as modules with HtDP

From: Norman Ramsey (nr at cs.tufts.edu)
Date: Sun Nov 17 13:27:04 EST 2013

[Shifting to plt-edu-talk]

 > > At Sat, 16 Nov 2013 12:44:03 -0500, Norman Ramsey wrote:
 >
 > >> On their next assignment, my students will reuse code they have built
 > >> for binary search trees.  I would prefer that they place the old code in
 > >> a different source file than the new code.  I tried doing this using
 > >> "require", but I cannot figure out how to get "require" to load a file
 > >> that is written in Intermediate Student Language. Is there another
 > >> mechanism I should try?  Is the thing I want to do even possible?

Matthias Felleisen replied:

 > Part of the HtDP philosophy is that I want students to ask for
 > concepts. For example, once you have written the same list template
 > over and over again, you want them to say "isn't there a way to
 > avoid writing this same schema repeatedly? and you're ready with "I
 > am glad you asked, here are loops defined in ISL and they are what
 > you want." In the same spirit, I want them to ask for modules and
 > components.

As teachers, how do we put students in situations where they are
stimulated to ask for modules and components?  Your list example is
apropos, and I have certainly written this data definition many times
this semester.  But my students have not once written 'require', nor
have they ever seen *me* write 'require'.  Over the course of the
term, there few functions that they see two or more times (search in a
binary tree might be one), and no functions that they see defined over
and over to the point of tedium.

To put some numbers on it, students might get 40 hours of lecture in
which to become bored and irritated by seeing the same data definition
over and over.  But they might get only 11 programming assignments,
and if repetition is the technique we use to get them to ask for
things, that repetition is going to crowd out something else?

So again, what situations do you put students in that motivate them to
ask for components and modules?


 > My personal preference is to (1) not have code from one assignment
 > be critical for the next one ... [this] is important for weaker
 > students.

I see merits both ways, and I tend to do some of each.  In real life,
code from last week can be critical for next week.  And I want to
militate against an experience that is too common among university
students: code is built, used, then thrown away and never examined
again.

But by having code from one assignment be critical to the next, I now
place myself in a difficult position:

  - I want them to reuse their earlier code.

  - I have told them that programming by "clone and modify" is not
    acceptable.  And I have asked N times in lab, "what part of the
    design recipe says to copy the solution to a previous problem and
    start editing it?"

  - I have given them no mechanism by which they can reuse a previous
    solution. 

For this term, I think I can't work my way out of this one: I can use
Matthew's workaround to get `provide`, but I have no infrastructure
that would enable them to submit a solution spread across multiple
source files...

I'd like to hear other teachers' thoughts on using modules in the
first course.  It is considered an important part of our current first
course, so if I want to get my colleagues to use the HtDP
infrastructure, I will have to have a better story about it.

Are you using modules?  How do you motivate them?  If you allow your
students to spread a program across multiple modules, what
infrastructure do you use to manage submissions?


Norman

Posted on the users mailing list.