🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.logo
Article #253

Re: um, maybe this is a silly question

#253
From: Rick Smith
Date: Tue, 13 Oct 1992 14:45
33 lines
2168 bytes
I wrote:

>>I suspect the "right" way to teach programming is to start with
>>recursion as the essential iterative technique, and then teach
>>how to convert from recursive to iterative as an engineering task.

And matt@volga.Berkeley.EDU (Matt Wright) writes:

>You mean, start with recursion as the essential iterative (and
>non-iterative) technique, and then teach how to do tail-recursion
>elimination when you take a compiler construction class in college.  :-)

Pretty much, but it's not enough just to deal with tail recursion.  If
people are using recursion as casually as Fortran coders use DO, then
they'll be producing lots of functions that don't convert directly
into tail recursion. Thus, they need to learn how to move the stuff
off of the stack (where it goes in recursion) and into data structures
with defined limits. A good example is, in fact, what gets taught in
some compiler classes: how to implement recursive functions for
parsing by using production rules, grammars, and such.

Most problem solving that people routinely do shouldn't require the
level of engineering required to convert recursion into interation.
You only need to do it if you're in a situation where you're worried
about reliability in the face of an uncontrolled range of potential
inputs. People writing computational expressions for spreadsheets, for
example, should do fine just with recursion and good stuff like MAP. I
always wanted to see a good spreadsheet or DBMS with a MAP function.

Rick.

p.s. to the original poster: isn't it great how much commentary the
     "maybe a silly question" produced, and at such a level?
Technical Details
Message-ID: <1992Oct13.144544.18182@sctc.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!gumby!destroyer!sol.ctr.columbia.edu!spool.mu.edu!umn.edu!sctc.com!smith
References: <1992Oct11.192128.5448@netcom.com> <1ba7vcINNpam@agate.berkeley.edu> <1992Oct12.163421.24051@sctc.com> <1992Oct13.035329.19258@pasteur.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.logo
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!gumby!destroyer!sol.ctr.columbia.edu!spool.mu.edu!umn.edu!sctc.com!smith
From: smith@sctc.com (Rick Smith)
Subject: Re: um, maybe this is a silly question
Message-ID: <1992Oct13.144544.18182@sctc.com>
Organization: SCTC
References: <1992Oct11.192128.5448@netcom.com> <1ba7vcINNpam@agate.berkeley.edu> <1992Oct12.163421.24051@sctc.com> <1992Oct13.035329.19258@pasteur.Berkeley.EDU>
Distribution: usa
Date: Tue, 13 Oct 1992 14:45:44 GMT
Lines: 33