[Tutor] General Programming Question

Michael Powe michael@trollope.org
Thu, 28 Jun 2001 09:53:07 -0700


>>>>> "alan" == alan gauld <alan.gauld@bt.com> writes:

    >> On Thu, 28 Jun 2001 alan.gauld@bt.com wrote:
    >> 
    >> > Recursion is all - other loop constructs are not mentioned.

    alan> So that message did go out - it dissappeared while I was
    alan> typing, presumably I found the hot key for Send...

    >> Recursion doesn't necessarily have to be expensive,

    alan> Its not about expense per se its about flexibility of
    alan> program construction. There are many different loop
    alan> constructs, some of which can be replicated using
    alan> recursion(while, for, etc) but others are much harder(*) -
    alan> and very much more obscure when done via recursion.

I think this misses the point.  Recursion is not a 'looping
construct,' although it can be used that way.  It is a design
paradigm.  The dialect of Lisp used in SCIP is Scheme.  Scheme is
defined as, "...a statically scoped and properly tail-recursive
dialect of the Lisp programming language ... "  

To continue quoting from the Scheme home page: "It was designed to
have an exceptionally clear and simple semantics and few different
ways to form expressions. A wide variety of programming paradigms,
including imperative, functional, and message passing styles, find
convenient expression in Scheme."  I think that pretty well covers it.

    alan> Other things that spring to minfd as "nails" are data
    alan> structures where in the "Structure" book everything has to
    alan> be reduced to pairs because thats the only data structure we
    alan> have!

    alan> OTOH the books coverage of OO vv stream based programming is
    alan> very good and the obligatory Lisp example of implementing
    alan> the Lisp engine in Lisp is better explained than in many
    alan> other texts.

    alan> I just think it tends to take a very singular view of
    alan> programming.

However, this is like criticizing a dog for having four legs and not
walking on only two.  Take a look at some of the peculiarities of
Python.  There must be a reason (whether a good one or no) why there's
no increment operator.  I take it that in python, it is a design
paradigm that you do not increment through loops.  No switch
statement, either.  Again, it's a part of the python paradigm that you
do not design programs that use those kinds of constructs.  From my
point of view (coming from C), that's a limitation.  I doubt
'pythonistas' would agree with me.

Every language requires you to adopt its paradigm.  Is SmallTalk
defective because it's purely OO?  I'd be the first to champion C
because you do everything in it.  Everybody knows what torture it is
to do string parsing in C.  You CAN do it, though.  ... uh-oh, I feel
... oh, no, I can't resist -- "There's more than one way to do it."
Aaaahhhhh!

mp

-- 
  Michael Powe                                 Portland, Oregon USA
'Unless we approve your idea, it will not be permitted, it will not be
allowed.'  -- Hilary Rosen, President, Recording Industry Association
of America