From: John David Stone
Subject: Re: Lisp compilers/books
Date: 
Message-ID: <50hbpv$suq@franklin.math.grin.edu>
	To Todd (······@nr.infi.net), to whom mail is undeliverable:

        The dialect of Lisp that is most suitable for students learning
their first programming language is Scheme.  There are several freeware
versions of Scheme for the IBM PC; I have used and can recommend
PCS/Geneva, which is available as a self-extracting executable at
ftp.cs.indiana.edu.  The file to download is

            /pub/scheme-repository/imp/pcs-geneva/pcscheme.exe

        MIT Press just published the fourth edition of _The little Lisper_,
which has now been retitled _The little Schemer_.  The authors are Daniel
P. Friedman and Matthias Felleisen.  The ISBN for the paperback version is
0-262-56099-2.  The same authors have also published a sequel, _The
seasoned Schemer_, ISBN 0-262-56100-X.

        _Programming pearls_ was written by Jon Bentley and published in
1986 by Addison-Wesley (ISBN 0-201-10331-1).  It was still in print last
fall, when I used it as a textbook in a class on software design.  There is
a sequel to this one, too: _More programming pearls_ (Addison-Wesley, 1998,
ISBN 0-201-11889-0).

        Please don't teach C++ to novices.

        If you have WWW access, you can find out more about Scheme at the
Internet Scheme Repository,

           http://www.cs.indiana.edu/scheme-repository/home.html

and at the MIT Scheme home page,

               http://www-swiss.ai.mit.edu/scheme-home.html

The _de facto_ definition of the language is on line at

           http://www-swiss.ai.mit.edu:80/~jaffer/r4rs_toc.html
                                     
Also, free to lift course materials from my two-week Scheme workshop at

          http://www.math.grin.edu/~stone/events/scheme-workshop/

-- 
======  John David Stone - Lecturer in Computer Science and Philosophy  =====
==============  Manager of the Mathematics Local-Area Network  ==============
==============  Grinnell College - Grinnell, Iowa 50112 - USA  ==============
==========  ·····@math.grin.edu - http://www.math.grin.edu/~stone/  =========

From: ······@nr.infi.net
Subject: Re: Lisp compilers/books
Date: 
Message-ID: <50j0t1$lk5@nw101.infi.net>
Before I forget, thanks to everyone who supplied information on this question!

>        Please don't teach C++ to novices.

I was wondering about this myself.  I know that my alma mater, NC State 
U. now begins with C++ for its programming classes.  But my dad is a professional
programmer, and he feels that a solid understanding of C language is necessary
to program in C++.  What would be a good language to go to after Lisp/Scheme, if
not C++?  Would C and then C++ be good?  Visual Basic?  Pascal?  I would like
to give them good understanding first and foremost, and something that they
could use to get jobs in the summer or whatever would be a nice second agenda.

Any help will be appreciated!

Todd
······@nr.infi.net, or if that doesn't work,
······@juno.com
From: John David Stone
Subject: Re: Lisp compilers/books (long)
Date: 
Message-ID: <udg24ynjz4.fsf_-_@post.math.grin.edu>
>           What would be a good language to go to after Lisp/Scheme, if
>  not C++?  Would C and then C++ be good?  Visual Basic?  Pascal?  I would
>  like to give them good understanding first and foremost, and something
>  that they could use to get jobs in the summer or whatever would be a
>  nice second agenda.

        There's no perfect choice -- it depends on what you think the
students should have a good understanding of.  I personally recommend C,
because I think that the most important things for students to understand,
after they are well launched into algorithms and data structures, are
low-level data representations, bit-twiddling, operating systems, and
computer architecture, and C is a fair medium for exploring those.

        Most of the college faculty that I talk to, however, seem to think
that the object-oriented programming style is the next most important thing
for CS students to know.  If you agree, you might want to try Common Lisp
with CLOS, or Java, or Smalltalk, or Eiffel -- each of these has strengths
and weaknesses, of course.

*flame on*

        Some high-school teachers are being forced into teaching C++
because of a horrible, bone-headed mistake made by the Advanced Placement
Computer Science Test Development Committee, a creature of the Educational
Testing Service and the College Board:  Beginning in 1999, solutions to
programming problems on the AP test in computer science must be written in
C++.  This means that the best high-school students, those who want to take
high-powered courses and receive college-level credit for them, will be
trying to learn C++.  High-school teachers are now frantically trying to
figure out how to choose a subset of C++ that includes all the
constructions that students might need in answering AP questions while
excluding all the rubbishy misfeatures that the College Board won't ask
about in a million years.  Some of the details of this melancholy story
are available at

           http://www.math.grin.edu/~walker/sigcse-ap/index.html

        Here are the characteristics of C++ that make it a teacher's
nightmare, particularly if it is the first programming language students
see:

        a) It is a very large and complicated language.  Syntactically, it
is an extension of C, which was already fairly complicated; but C++
includes lots of new and highly irregular syntactic constructions.
Individually, some of these constructions are OK, kind of, though they
follow the C tradition of being easier to write than to read; but because
they were added one by one, by accretion, not enough thought was given to
their combinations and interactions.  (As a small example of the kind of
thing I mean, you might consider the implications of lumping auto, const,
explicit, extern, friend, inline, long, mutable, register, short, signed,
static, typedef, unsigned, virtual, and volatile into a single syntactic
category, ``specifier.''  The explanation of which of these specifiers can
be combined and which cannot, and what happens when they are combined in
various ways and orders, occupies many pages of the C++ draft standard and
is a quagmire for teachers.)

        b) It is a badly designed language.  Starting from the unlikely
premise that grafting object-oriented extensions onto a popular low-level
procedural language is a plausible way of enabling large numbers of
programmers to migrate painlessly into an object-oriented programming
style, the author of C++ repeatedly succumbed to market pressures to add
``features'' to the language, regardless of their design, requiring only
that they met the C++ goals of being extensions of C and permitting
reasonably fast compilation into fast executables.  Many of these features
(run-time type inference and multiple inheritance are two prominent
examples) are extremely ugly, and very, very few of the existing programs
that use them use them correctly.

        c) It is not yet standardized.  As a result, most programs in C++
are not portable.  They've been working on the preparation of the standard
for years, and it's supposedly nearly done now.  The last version of the
draft standard that I know of can be found at
http://www.csci.csusb.edu/dick/c++std/september/index.html.  But the draft
standard has been repeatedly revised, in ways that are not compatible
either with existing C++ implementations or with one another, at regular
intervals since its first appearance.  The version cited above includes a
fairly well-designed container and algorithm library, known as the Standard
Template Library, that is in my opinion the best feature of the language.
But no textbook yet published deals with it, because it was added to the
draft standard only about a year ago, replacing a whole series of libraries
that used a completely different interface.

        d) C++ programs are obscure and hard to read.  Partly this is due
to C's large variety of one- and two-character operators, a problem that
C++ compounds by allowing those operators to be overloaded with arbitrary
new meanings for operands of programmer-defined types, and to C's weird
syntax for declarations, which C++ preserves and elaborates.  But C++ also
adds a variety of complicated scope and access indicators that initially
puzzle many students -- not to mention namespaces and templates.

        e) It's easy to stray into uncharted waters in C++.  Since no sane
person would attempt to teach or to learn the entire language at once, each
textbook author and each teacher has to select the part of the language
that she wants to cover.  Ideally, students would stay within this subset.
In practice, students always stray over the boundaries their teachers set
and try things, either to see what will happen, or because they've read
about them in some other textbook, or because they work in C, or simply by
accident.  Then they want to know why their experiments don't work, or,
worse yet, why they do work but yield unexpected results.  The teacher has
to know much more of the language than she actually teaches, in order to be
able to answer such questions.

*flame off*

-- 
======  John David Stone - Lecturer in Computer Science and Philosophy  =====
==============  Manager of the Mathematics Local-Area Network  ==============
==============  Grinnell College - Grinnell, Iowa 50112 - USA  ==============
==========  ·····@math.grin.edu - http://www.math.grin.edu/~stone/  =========
From: William Paul Vrotney
Subject: Re: Lisp compilers/books (long)
Date: 
Message-ID: <vrotneyDx96wL.E78@netcom.com>
In article <·················@post.math.grin.edu> John David Stone <·····@math.grin.edu> writes:

Basically I agree with most of what you say about C++, but I wanted to
augment with a few notes about STL.

>           c) It is not yet standardized.  As a result, most programs in C++
>   are not portable.  They've been working on the preparation of the standard
>   for years, and it's supposedly nearly done now.  The last version of the
>   draft standard that I know of can be found at
>   http://www.csci.csusb.edu/dick/c++std/september/index.html.  But the draft
>   standard has been repeatedly revised, in ways that are not compatible
>   either with existing C++ implementations or with one another, at regular
>   intervals since its first appearance.  The version cited above includes a
>   fairly well-designed container and algorithm library, known as the Standard
>   Template Library, that is in my opinion the best feature of the language.

If STL is the best feature of the language then C++ is in trouble.  Although
the design of STL and the concept of Iterators is clever, the Iterators
paradigm does not seem to fit lists very well.  It better fits containers
like Vectors and Deques.  Most containers supplied, including the last two I
cited are represented as arrays.  If you want to use lists you have to use
doubly linked lists whether you like it or not.  Clearly, insertion into
doubly linked lists is less efficient than singly linked lists.  This was
done, as far as I can tell, to accommodate the generality of Reverse
Iterators.  So here we have the C++ experts, who profess program efficiency
extremism, accepting less efficiency for the sake of generality.

Furthermore lists are treated only as simple sequences.  There is no concept
of a Cons as in Lisp where not only sequence lists but trees can be built.
I guess if you want to build trees you are expected to define special tree
nodes for every type you want to hang in a tree.  Either that or you are
expected to purchase some vendors tree library.  You can not have
heterogeneous containers.  I suppose the C++ experts have a problem here
with these kind of data structures, and so avoid them, because this
difficulty is an inevitable result of static typing.  They help, but things
like virtual functions and RTTI are clever tricks in the small, they don't
cut it for the big picture.

Finally, templates themselves are another clever invention.  But for all
their time efficiency achievements they introduce a space efficiency problem
called "code bloat".  Although syntactically templates seem rather harmless,
for a complex system with a lot of types the myriad of permutations of
common methods on those types results in a huge amount of code generation.
And for existing computers, space and time are still related.  STL attacks
code bloat by having a clever static way to pass function objects but it
doesn't eliminate it.

The bottom line, IMHO, is that if you want to write the same kind of
programs that you typically write in Lisp, STL does not go out of its way to
be helpful here.

>   But no textbook yet published deals with it, because it was added to the
>   draft standard only about a year ago, replacing a whole series of libraries
>   that used a completely different interface.

There is a textbook called "The STL Tutorial", authors Musser & Saini.



-- 

William P. Vrotney - ·······@netcom.com
From: David Mccaughan
Subject: Re: Lisp compilers/books
Date: 
Message-ID: <50o0jb$aa6@pulp.ucs.ualberta.ca>
······@nr.infi.net wrote:

: >        Please don't teach C++ to novices.

: not C++?  Would C and then C++ be good?  Visual Basic?  Pascal?  I would like
: to give them good understanding first and foremost, and something that they
: could use to get jobs in the summer or whatever would be a nice second agenda.

In my experience, the problem with C++ is that the ``object-oriented''
distinction is often lost in the shuffle.  OO is not a language, but rather
a design methodology.  In theory, an OO language such as C++ should lend
itself to implementing your OO designs, which indeed it does.  This should
not be taken to mean anything in particular.  I for one am not fond of many
C++'isms, and although almost exclusively produce OO designs, do most of my
coding in C.

C++ does nothing in particular to force an OO paradigm on the user, and too
often I see C++ code that is little more that C wrapped in ``class''.  For
those who know what they're doing, C++ can be a powerful tool, however it is
too easy for beginners to write bad C++ from the outset, and it's tough to
break the habits later.  Better to go with a procedural language first, then
once the notion of design is breached, and OO better appreciated by the
programmer, C++ becomes an option.

Note that I do not feel that C is necessarily a required stepping stone to
C++.  PASCAL is a good teaching language as most of the basics of a modern
programming language are present, however with a great deal of protection
in terms of not shooting oneself in the foot (PASCAL is not a very practical
language from the jobs standpoint however---see your local classifieds if
there are any doubts on this point :).  I've found C to be fairly easy to
teach to those with a PASCAL background.

This is, of course, only my $0.02 worth ($0.03 with GST).  I'm sure other
computing people will have varying opinions on this subject.

----------------------------------------------------------------------------
 David B. McCaughan                         Department of Computing Science
 Biological Computation Project                       University of Alberta
                                                               Edmonton, AB
 ······@cs.ualberta.ca                                              T6G 2H1
 http://web.cs.ualberta.ca/~davidb                                   CANADA
----------------------------------------------------------------------------
From: Jack Campin
Subject: Re: Lisp compilers/books
Date: 
Message-ID: <1571@purr.demon.co.uk>
······@cs.ualberta.ca (David Mccaughan) writes:
>In my experience, the problem with C++ is that the ``object-oriented''
>distinction is often lost in the shuffle.
[wibble wibble]

You crossposted that to sci.logic and sci.math.

It has no conceivable relevance to logic or mathematics.

Go away and learn how to use your newsreader.

-----------------------------------------------------------------------------
Jack Campin                                             ····@purr.demon.co.uk
T/L, 2 Haddington Place, Edinburgh EH7 4AE, Scotland       (+44) 131 556 5272 
---------------------  Save Scunthorpe from Censorship  ---------------------
From: Sunil Mishra
Subject: Re: Lisp compilers/books
Date: 
Message-ID: <efy7mq7boa2.fsf@cleon.cc.gatech.edu>
In article <··········@nw101.infi.net> ······@nr.infi.net writes:

\\ Before I forget, thanks to everyone who supplied information on this question!
\\ 
\\ >        Please don't teach C++ to novices.
\\ 
\\ I was wondering about this myself.  I know that my alma mater, NC State 
\\ U. now begins with C++ for its programming classes.  But my dad is a professional
\\ programmer, and he feels that a solid understanding of C language is necessary
\\ to program in C++.  What would be a good language to go to after Lisp/Scheme, if
\\ not C++?  Would C and then C++ be good?  Visual Basic?  Pascal?  I would like
\\ to give them good understanding first and foremost, and something that they
\\ could use to get jobs in the summer or whatever would be a nice second agenda.
\\ 
\\ Any help will be appreciated!
\\ 
\\ Todd
\\ ······@nr.infi.net, or if that doesn't work,
\\ ······@juno.com

Well, the way the undergrad CS curriculum at Northwestern works (at least
when I left) was that the first two classes are centered around
scheme. The first class is basically programming techniques and so on, the
standard stuff - data directed programming, some ideas about OO, recursion,
symbolic processing etc. The second class is half scheme and half C++, and
is centered around the internals of the language. The C++ part involves
taking stubs of C++ code and filling out the details of a scheme
interpreter. These students have never seen C++ before, presumably, and
it's hard, but I have never heard of anyone complain about the quality of
learning they have. (If any NU students out there disagree...)

In short, I think learning the ideas behind programming is the key. If you
know the ideas, you can pick up a modern language in the matter of a couple
of weeks. You may not be any good at it, but you can begin reading it quite
comfortably.

Sunil
From: Allen Adler
Subject: Re: Lisp compilers/books
Date: 
Message-ID: <2gybimewlj.fsf@pulsar.cs.wku.edu>
Sunil Mishra writes:

>   In short, I think learning the ideas behind programming is the key. If you
>   know the ideas, you can pick up a modern language in the matter of a couple
>   of weeks. You may not be any good at it, but you can begin reading it quite
>   comfortably.

That makes a lot of sense. For that reason, I wonder what would be
lacking in a course based on Knuth's Art of Computer Programming?

Allan Adler
·····@pulsar.cs.wku.edu