Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!gatech!csulb.edu!hammer.uoregon.edu!news1.mpcs.com!news.radio.cz!newsbreeder.radio.cz!news.radio.cz!CESspool!news.apfel.de!news.maxwell.syr.edu!newsfeeds.sol.net!ix.netcom.com!vrotney
From: vrotney@netcom.com (William Paul Vrotney)
Subject: Re: First Language=LISP?
In-Reply-To: Derrick Storren's message of Tue, 18 Feb 1997 19:33:53 -0500
Message-ID: <vrotneyE5vq3z.1Bp@netcom.com>
Organization: Netcom On-Line Services
References: <330A4A71.977@sprynet.com>
Date: Thu, 20 Feb 1997 02:11:59 GMT
Lines: 82
Sender: vrotney@netcom.netcom.com

In article <330A4A71.977@sprynet.com> Derrick Storren <dekkard@sprynet.com> writes:
> 
> I have a project for my children (who are taught at home).  It is to
> learn a programming lanuage.  I've searched for quite a while to find a
> language that was clear, clean, flexible, powerful and advanced.  I've
> been offered one expert opinion so far and it lead me here.  I've been
> reading about LISP for three days now and love what I've found out so
> far.
> 
> If anyone here would care to remark as to whether children 14, 12, and
> 10 chould be subjected to LISP as a first language I will appreciate any
> comments that might flesh out my perceptions a little.
> 

I would *highly* recommend Lisp as a first language over C++ for one simple
reason, that it is highly interactive and exploratory.  It is a lot like
Basic (but only in this respect).  For example the kids can start out typing
expressions and getting results instantly

        (+ 1 2)
        3

        (setq number-holder 2)
        2

        number-holder
        2

        (+ 1 number-holder)
        3
        
        (defun add-two-numbers (a b) (+ a b))
        ADD-TWO-NUMBERS

        (add-two-numbers 1 2)
        3

So they can gradually work on building up concepts on their own.

In my opinion the obscurities of C++ and the C++ compiler errors would
frustrate and impede the student from learning the important aspects of
computer science, whereas with Lisp he would zoom ahead quickly.

Of course I am a Lisp advocate, if you ask a C++ advocate you may get an
entirely different set of reasons.


> The only drawback I've found is a remark by one author of a LISP text
> who, in comparing LISP to C++ type languages, thought that LISP was more
> difficult to use in writing "good" programs because it required more
> logically planned programming techniques or a greater abstraction.  This
> would seem to be plus is one is attempting to learn a language partly
> for applying sound, logical thinking to problems.  At least to me, but
> I'm not entirely sure if I understood what he meant as I have only been
> exposed to programming a rudimentary way.
> 

If I can guess at what that author was talking about it is that C++ forces
you to think in terms of defining your problem in terms of classes and
operations on those classes.  For example if you define a class and a method
to work on that class and that method is not declared and defined as a
member of that class the compiler will complain and not let you go any
further.  Lisp is more free form.

When you define a class in Lisp and then define methods, those methods do
not have to be associated with anything except that one of the arguments to
the method dispatches on a class.  For example if you define a class for
Automobile and make car1 be an instance of Automobile then you can type

        (put-gas-into car1)

Unlike C++ the method put-gas-into can be defined anywhere at any time.

So that in C++ you are forced to be real regimented where as in Lisp you can
be quite a bit more spontaneous and the system is more forgiving.  Whether
regimented programming produces "good" programs is a highly debated issue
these days.


-- 

William P. Vrotney - vrotney@netcom.com
