Wednesday, November 22, 2006
Using Scheme in the so-called real world?
This is a follow-up to yesterday’s post about replying to student questions concerning applicability of a math topic in the “real world.” At Weston we get a similar question with regard to our selection of Scheme as the Math Department’s programming language of choice in regular math classes and in Intro to Programming. There are admittedly extremely few commercial applications written in Scheme or closely related languages, and it’s unlikely that a student will find a summer job programming in Scheme. So why do we teach it?
As I type this, the very question looks odd to me. In an academic high school, we don’t teach what we teach because of its short-range utility in the world of employment. “Go to a vocational school for that,” we reply somewhat snobbily. But, just as I said yesterday in regard to logarithms, that answer is rightfully perceived as non-responsive. Among the real reasons we teach Scheme in a Math Department are the following:
From Boston:
As I type this, the very question looks odd to me. In an academic high school, we don’t teach what we teach because of its short-range utility in the world of employment. “Go to a vocational school for that,” we reply somewhat snobbily. But, just as I said yesterday in regard to logarithms, that answer is rightfully perceived as non-responsive. Among the real reasons we teach Scheme in a Math Department are the following:
- It has almost no syntax rules. Basically, you’re thinking in algebra: the Scheme world consists primarily of functions and variables. The big ideas of inputs and outputs, domain and range, and composition of functions all flow automatically from working in this language.
- The learning curve is very reasonable: in a very short amount of time, one can learn to write an interesting program.
- Looping in Scheme is based on recursion.
- Continue (conference management software)
- A bunch of games, packaged with DrScheme, which is the version we use at Weston
- Margrave (a security policy analyzer)
- MzTake (a debugger), about which Shriram Krishnamurthi comments as follows:
(The only sensible thing to do when faced with a Java program is to switch to Scheme.) The Java debugger was selected as one of the award papers at a software engineering conference of people who have no affection for, and perhaps a slight antipathy to, Scheme. That's because smart people recognize good ideas. You should ask your students how they fit that description. (-:
- Abstrax (hard to describe, but definitely commercial: see their website)
- See also Functional Programming in the Real World, for a list of more applications.
From Boston:
I am sincerely sorry that my colleagues told you that Scheme is useful. I also won’t mention that Disney controls virtual rides with it, that the Air Force controls telescope batteries, that the Navy runs its weather service for all carrier borne jet fighters, that Motorola has an ordering system for packaging hardware, that .. oh, I didn’t mean to.And from Waterloo (Ontario, not Belgium):
If your kids are so smart that they know now already what is useful and what’s not, you are wasting your time on them. Tell them to leave the class now. You don’t want to waste their time with stupid, useless, filthy parentheses.
P.S. Oh, and don’t tell them that with Scheme you can write a six line program and get a movie of a rocket launch in the very first lesson (instead of public static void(String argv[]) { System.out.println("hello world"); }), and everyone can understand it too. We wouldn’t want to keep them in class and waste valuable minutes on them.;; Beginner, world.ss...
(define (y-coordinate-for-rocket-at t) (- 300 (+ 20 10 (* 8 t))))
(define (create-picture t) (place-image 150 (y-coordinate-for-rocket-at t) (empty-scene 300 300)))
(define (tock t) (+ t 1))
;; run program run:
(big-bang 300 300 (/ 1.0 20) 0) ;; 20 frames per second
(on-redraw create-picture)
(on-tick-event tock)
The question has come up several times this semester and of course in years before. Here is how I really answer it:
“We have chosen the least popular programming language that we could find for this course. We believe that is also completely useless as a practical language and has no practical applications whatsoever. If you find one, please do not share this with the class or we have to look for an even more useless language.
Your first (and second and third) course in this beautiful subject should not be about a language, a sheer notation. Sure, you will need to master some of its vocabulary and grammar but the focus is on systematic problem solving. This is what you will take away from this course and it is something that you will remember for years to come. It will change your life. It’s more useful than mathematics in middle school and most high school grades. It’s as useful as English.
So hang in there and wait for a few weeks. If you find that this is challenging even though you know 2 or 3 programming languages already, that’s the intention. Because this is the pure essence of programming, unmarred by notation issues of whether ‘;’ is a separator or a terminator, of whether it’s object-oriented or class-based, etc.”
Scheme is a vehicle for ideas. My students in week 4 of a first-term, first-year course sail through concepts that students using Java in the mainstream courses are beating their heads against in week 6 of the next semester. I put bonus/challenge/enhancement materials on assignments in weeks 6 through 8 that provide simpler looks at topics with which students struggle in third- and fourth-year courses. The practical side of this is that Scheme is great for prototyping, getting a quick sense of whether an idea is feasible. There’s a response I sometimes give, along the lines of Matthias’s sarcasm but slightly more gentle, which goes like this: “Ever visit a gym? You were wasting your time. I’ve never seen a Nautilus machine or a treadmill outside a gym. Barbells — repeatedly lifting two balanced weights connected by a narrower piece of metal — completely contrived and artificial....”
While we can point to commercial systems that use Scheme, we cannot allow the debate to be framed in these terms. That is not the only metric, nor the most important one.
Labels: teaching and learning, technology, Weston
ARCHIVES
- May 2005
- June 2005
- July 2005
- August 2005
- September 2005
- October 2005
- November 2005
- December 2005
- January 2006
- February 2006
- March 2006
- April 2006
- May 2006
- August 2006
- September 2006
- November 2006
- December 2006
- January 2007
- February 2007
- March 2007
- April 2007
- May 2007
- December 2007
- January 2008
- February 2008
- March 2008
- April 2008
- May 2008
- July 2008
- November 2008
- December 2008
- January 2009