One reason that I started this blog was to record my experiences with a new course on functional programming for freshmen at Carnegie Mellon. Classes have ended, the final exam is graded, and we are in the process of taking stock of what we accomplished, and what we could do better. This was the first instance of the course, taught to 83 first-year computer science students who volunteered to be part of the new curriculum. (This represents about 2/3 of the freshman class.) All had taken a new course on imperative programming taught by Frank Pfenning the previous semester, and all were simultaneously taking 251, the legendary theory foundation course developed here over the last dozen or so years.
Starting this fall the course will be part of the standard curriculum, and will be taught to a broader range of students, including the electrical engineers and the full class of CS students. We’re still working out whether the standard order will be imperative, then functional, or functional, then imperative. Much depends on the mathematical maturity of the incoming students. Those with weak mathematical skills (the vast majority), but some programming experience, will likely start with imperative programming, which they will take simultaneously with a standard discrete math course taught in the mathematics department. Those with strong mathematical skills, or high ambitions, will start with functional programming. A small number will park for one semester, taking discrete math and a programming course primarily intended for non-majors, to bring themselves up to speed.
Our new data structures and algorithms course, being developed by Guy Blelloch, will be offered in the fall for students who have already have the IP and FP classes. Guy plans to make heavy use of functional programming, and will be stressing parallel algorithms on persistent data structures as the common case, leaving the traditional sequential, ephemeral case to the imperative programming class. Guy’s course is essentially a continuation (ahem) of the FP class that emphasizes more sophisticated data structures and algorithms, and more complex programming problems.
For those who might be interested, I’m attaching the final exam for the course. The students did exceptionally well (average score of 88%), even though we feared it was too long and difficult beforehand. The spread was very narrow, perhaps because the exam was too easy, or because this being a class of volunteers, their skills were unusually strong and uniform. We’ll know more after the fall once we’ve taught the class to a broader range of students. I do think the exam is representative of what we expected them to be able to do at the end, and they showed us that they can do it. A clear success!