What Programming Language Should we Teach to CS Majors?
Wednesday, February 27th, 2008Yesterday I went on some sort of massive rant about Java, and programming languages in general. It’s actually kinda ironic that it took me a little over 2500 words to essentially say “I somehow always knew Java was to verbose for it’s own good”. I used to think that it was a good academic language though - because it forces students to think within the OO paradigm, makes them deal with stuff like static typing and has a huge library of classes they could use for just about anything. Not only that but Java is popular and widely used in the industry. So it seems like a perfect match. But is it?
The thing about Java is that it is all about Objects - that is it’s answer to everything. And when the only tool you have is a hammer then every problem starts to look like a nail. Especially since nowadays I see people teaching Java using BlueJ. I really don’t think that works - I think it compounds the problem. I talked to some of these students after they spent two semesters using that IDE and they seemed to be really, really lost and confused. But perhaps I’m wrong and I just encountered the students who were never meant to be programmers.
There is another criticism of Java which I heard - Java students get to reliant on the API. Since they have every possible data structure and algorithm implemented for them they no longer really learn how to do them. The data structures and algorithms classes are just mindless chores to them - they stumble through them, then put them out of their mind - cause why would they ever need to know how a hash table works if they can just import one.
I hear some universities teach their introductory programming courses using Scheme which is the opposite side of the coin - here you teach them a lisp dialect which is a functional language with tons of quirks which is unlike anything else they might encounter in the industry. And while it is great for academia and teaching basic concepts (scheme trained students actually understand recursion very early on) it is unlikely they will actually find a job working with Scheme out of school. Arguably though, the jump from Scheme to Java should be easier than the other way around.
And then there is C++ with all it’s quirks and infuriating little issues. Should we just teach C++ as the initial language and make the students get down and dirty with manual memory management? Some say that this low lever familiarity with your hardware will make you a better programmer - and I’m not opposed to this idea. I don’t have a strong C background but I always wished I did.
Or perhaps we could just do C# which straddles the gap between Java and C++? It offers the best of both worlds so to speak and is also very popular in the industry these days.
Or should we go with the flow and pick something that is both popular, elegant, duck typed, interpreted and easy to pick up like Ruby? It would be an interesting experiment to see how it would fare as “the first” language.
What language did you learn first? Which language do you think we should be teaching to the new CS majors right now?
Do you think that ability to deal with the low level thinking that C++ imposes on you is really important? Or do you think that academia should teach them how to program using high level abstract concepts first and foremost?


