Newsgroups: comp.lang.c++,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!pipex!uknet!festival!edcogsci!jeff
From: jeff@aiai.ed.ac.uk (Jeff Dalton)
Subject: Re: Comparing productivity: LisP against C++ (was Re: Reference
Message-ID: <D1Fp23.yK@cogsci.ed.ac.uk>
Sender: usenet@cogsci.ed.ac.uk (C News Software)
Nntp-Posting-Host: bute.aiai.ed.ac.uk
Organization: AIAI, University of Edinburgh, Scotland
References: <hbakerD15HAI.GCL@netcom.com>> <D182M9.By1@cogsci.ed.ac.uk> <LOFASO.94Dec23082445@gandalf.arlut.utexas.edu>
Date: Mon, 26 Dec 1994 20:03:39 GMT
Lines: 48
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:104878 comp.lang.lisp:16193

In article <LOFASO.94Dec23082445@gandalf.arlut.utexas.edu> lofaso@gandalf.arlut.utexas.edu (Bernie Lofaso) writes:

>The simple observation that people with much Lisp expertise had to
>look up file I/O smells more than faintly of people who deal with
>specialised programs that probably wouldn't meet most definitions of real
>world programming. (Alert! Sweeping generalization here. Insert your own
>doubt factor to achieve comfort.)

Well, I sometimes have to look up some things about file I/O.
Perhap it's for something I haven't done in a long while (or ever)
or maybe I'm wondering about a borderline case that I think might
come up.  I don't think it's much different from looking at Unix
man pages (which I also do, even though I'm a fairly experienced
Unix user).

OTOH it's at least arguable that I don't do real-world programming
these days (I work for a University and mostly write AI programs).

>I would tend to agree with another common conception, that being that, in
>general, Lisp programs are frequently less efficient than their C or C++
>counterparts. Much of this conception, in my opinion, is due to the lack of
>data structure richness in early Lisp dialects. Obviously, code
>inefficiencies result if I must represent everything as a list rather than
>say a struct. Common Lisp has gone a long way to enriching available data
>structures and I think it likely that good CL programmers can approach C
>and C++ efficiency in most programs. What they won't tell you when they
>make their "I can be nearly as efficient as you" argument, is that there is
>an additional level of effort involved and their productivity ratio suffers
>greatly. There ain't no such thing as a free lunch - remember. 

You're right about *some* aspects of efficient Lisp.  If I have to
add declarations, it might slow development time (though in many cases
I've already written the declaration-filled code and can reuse it).

However, you seem to be making this point in connection with the use
of structs rather than lists.  I don't think there is a significant
additional level of effort here.  Indeed, the code one now writes
using defstruct is simpler, sorter, easier to write, and less
error-prone than what people typically wrote when using lists all
over the place.  Even if I am using lists, I'll often still use
defstruct because it makes the effort of defining constructors,
accessors, etc so much easier.  Remember that you can say :type list
in a defstruct, e.g.:

  (defstruct (person (:type list))
    name age address)

-- jeff
