What Should Change in Comp Sci Education

I believe I received as good of a computer science education as exists.  This essay is not targeted at my education, nor any other particular school, faculty, nor individual, but rather how computer science is generally taught across the board.  In fact I know of no college or university that teaches it the way that I'll suggest.

 

Joel (from Joel on Software) recently wrote an essay on JavaSchools that is largely on-mark (except for the MapReduce comment, but I can explain why he's wrong about that later :-)).  He captures part of the problem, but he misses what I think the real problem is...  I agree that Java is an inadequate language for teaching CS, but so is C++ and Scheme.  What's missing in computer science education is that we don't teach students how to be fluent in multiple languages (or rather multiple paradigms) -- we don't give them multiple tools to use, and furthermore we don't teach them how to determine what language abstractions are the right ones for a given task.

 

You're probably saying to yourself, "But I took a semester of programming languages and we studied 24 different paradigms of programming -- and while I've forgotten all of them, it was cool while I took it."   Learning programming languages in one semester and then promptly never using the concepts again is only slightly better than never being introduced to the concepts at all.  We have to do better than that.  And simply letting students pick any language they prefer is not sufficient.  There is enough difference in ability between the 25/75th percentile of students that good students could do all their assignments in assembly language and still pass their courses. 

 

What a C.S. curriculum should be is four years of using different languages/paradigms to solve different types of problems.   Part of a computer science education should be an understanding of what language constructs would be useful to solve a given a problem, and how to solve a given problem given the constraints of a given paradigm.  This does a few things: (1) It puts a wide range of programming languages at the disposal to a computer programmer, but more importantly (2) does not limit the thought process of the programmer to what any single language contains.  (3) Lastly, it teaches students that there is more than one way to skin a cat (although it's always been unclear to me why we even need to skin cats). 

 

Here's a fun exercise, find a friend who essentially only writes in a conventional OO language and ask them to implement some graph algorithms in a functional language.  Almost everything they know about OO/imperative languages works against them in this exercise.  Often times the functional solutions are scary elegant, but 9 times out of 10 they won't figure them out on their own given their taint.

 

Joel's article also mentions that people are using Java to solve interview programming problems,.  One thing I notice in interviews is that when I ask people what language they'd like to program in they answer "language X", even before I've told them the problem. This is disappointing in that they may have just picked a language which is not appropriate for the problem.  Never have I heard someone say, "Let me hear the problem and then I'll pick the language that I'll use to implement the solution". 

 

One reason for the current situation is that most people know only one language well and they use that language for all their work (it's the "everything looks like a nail syndrome").  Language specific frameworks are one reason why this occurs, and it's unfortunate that there's been relatively little work to make languages work well together (the CLR is one of the few mainstream attempts at this).  The result of this is that people develop expertise in only one language, or tend to follow the flavor of the year (apparently this was Ruby for 2005).  Unfortunately, even when people language-hop (from Java to Python to Ruby, for example) they tend to stick with Algol-style languages almost exclusively.

 

I must say that if such a curriculum does exist, I'd love to know about it -- it would be a great place to recruit from.