[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: functional programming is great, but why lists?



Bill Richter wrote:

> But I have a few nephews & nieces of approx high school age, and I'm
> always tempted to try to pull them into PLT Scheme.  But I wonder how
> I'd answer that question, 
> 
> "Why are we using such a strange data structure?  It takes a lotta
>  cleverness to get at the innards of a list (a (b (c (d)))), it'd be
>  easier with vectors (a, b, c, d).  Just reversing a list to get (d (c
>  (b (a)))) is itself a recursive gem."

The answer is,

  If you think about this too much, you are liable to get yourself in
  the soup.  If you use the design recipes in How to Design Programs,
  there's nothing gem-like about writing REVERSE -- it's easy, simple
  and boring, just as it should be.

Hundreds of high school and college students are going through this
material without asking the question you raise.  I notice you very
nicely point out that these are questions your neices and nephews
*might* ask.  Why don't you actually teach them How to Design
Programs, and come back and report what they actually *do* ask?  I bet
the only person asking it is you, not them.

> I appreciated the poetry, I really liked your scramble, and that's in
> the 1st chapter!  Just not clear how to sell such poetry to the young.

Easy.  If you have someone confused by it, you don't try teaching them
The Little Schemer.  That's the lacuna How to Design Programs was
written to fill.  To be safe, begin with HtDP and graduate to TLS only 
if they find the going too slow.

Life's too short to deal with a billion different hypothetical
questions about pedagogy, Bill.  And this list isn't really the right
place for this topic, either.

Shriram