[plt-scheme] Was HTDP 21.1.2 - Why I "don't" use the design recipe

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Thu Jul 13 07:29:06 EDT 2006

A few points:

Given a(n algebraic) type definition there is a mechanical
process for defining the universal traversal (fold)
directly from that definition.  Given that this traversal
is universal, every function of data of this type is going
to be a variant of this universal traversal.  So the
structure of the program follows the structure of the data.
 This is one of the big ideas that the design recipes
leverage, and why it has the emphasis on data definitions
etc.  If you define the contracts and the data the code is
almost an afterthought -- most of it is mechanical.

A paper about fold and friends is:

  Functional Programming with Bananas, Lenses, Envelopes
and Barbed Wire. 
http://citeseer.nj.nec.com/meijer91functional.html

[Though I don't remember it as being particular readable!]

Don't forget that HtDP is about teaching programming, not
maintenance or bad habits.  These later tasks are
traditionally handled by industry, a job which is usually
performed with great energy and skill.  The lamentable
state of the average commercial programming team is not an
argument for teaching that poor practice.  Programmers
should know how to do better so they can, when they start
their own companies or move to positions of power in
someone else's.

I agree that documentation (data definitions, contracts)
can easily get out of the date.  One of the main thrusts of
PLT's research is programmatic representations of this
information.  See the contract system, for example.

HTH,
Noel

Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Posted on the users mailing list.