Why Can't Programmers.. Program?

About 8 years ago, after a UK conference on teaching the new language of Java, one of the attendees said that we certainly needed to change something – the final year students on the Comp Sci course at his prestigious university were not confident in writing any program, even one just 10 lines long. Other people there agreed that it was not much better, if any, where they worked. Surprised, I went back to my much less prestigious place where all our students took joint degrees, Computing and Maths, Computing and History etc and and checked with my final year OO class. I had real difficulty explaining the question, even though I upped the size to 20 lines – they just could not imagine anyone on our (half a) degree course, even those who had dropped programming at the earliest opportunity, being unable to write proper programs. What was the difference? Maybe a culture of 100% attendance, and the fact that, not being much of a research establishment, we did not farm out the practical labs to uninterested grad students.

On recursion, I stand by my advice to students. You should know what it is, how it works, and how to program it. But you should never use it in production code, because whoever maintains it may not grasp what is going on.

On swapping the values of two variable without involving a third, I am torn. I agree it is irrelevant to much of modern programming, and is probably not taught in most places. But it does provide a good test to see if someone has read around the subject a bit – and if they haven’t heard of it you could use it like Ben’s test to see if their eyes light up when you say it is possible.