[Edu-sig] Python for CS101

Toby Donaldson tjd at sfu.ca
Fri May 6 17:53:59 CEST 2005


>>I've spoken to a few teachers at a school that tried the Scheme-first
>>approach, and the students generally *hated* it. I've talked to students
>>who
>>took a CS2 data structures and algorithms course in LISP, and they claimed
>>to *hate* the course --- while at the same time saying "LISP was lots of
>>fun!".
>>    
>>
>
>If I cam be considered a market survey of one -  the LISP alternative, not
>before mentioned - does have some life to it.
>
>Ordered and just received "Practical Common Lisp", which other than some
>database books I needed for reference on work projects, is the first
>non-Python programming book I have bought in some time.
>
>It's the first affirmative move I have made toward supplementing what I have
>learned about programming from Python by exploring outside of Python, and
>comes after some period of sniffing around all the likely alternatives, from
>C++, to Ocaml, to Scheme, etc.
>
>Peter Seibel, the author of "Practical Common Lisp", somewhat laments the
>fact that the exposure of many to LISP is through Scheme.
>
>"If you studied LISP is college and came away with the impression that it
>was only an academic language with no real-world application, chances are
>you learned Scheme." 
>  
>
I love LISP and Scheme. I've used both extensively. My critique is not 
that these languages have no real-world application, but just that 
*most* real world applications (and programmers) don't use them, and 
most students know it. The beauty of Python is that it borrows many of 
the best ideas of LISP and other academic languages, but remains far 
more practical.

A couple of other problems I see with LISP/Scheme are:

 - The fact that LISP/Scheme programs are lists is really just a hack to 
make parsing LISP/Scheme programs easier. It's suddenly much less of 
feature when you are parsing other sorts of strings, or not doing 
parsing at all.

 - It privileges lists over other data structures: lists, strings, and 
vectors must all be treated differently.

 - It's generally harder to make efficient programs LISP/Scheme than in 
"imperative" languages. This is not to say that  efficient programs 
cannot be written in these languages, just that it typically requires 
more work on the part of a programmer to do so. For instance, to write 
an efficient queue data structure (where adding and removing form the 
queue are always constant-time operations) in LISP/Scheme requires using 
arrays. This is a design flaw that is not obvious to beginners. It 
forces them to know something about how LISP works under the covers. 
Knowing how your tools work is certainly a good thing, but not if the 
main reason is to work around language flaws. This brittleness and lack 
of transparency is, I think, part of LISP/Scheme's failure to catch on 
in the real world.

Again, I think LISP/Scheme are great, and everyone interested in CS or 
programming would learn a lot from studying these languages. I just 
don't think they are the right choice for CS1.

Toby


More information about the Edu-sig mailing list