Yesterday, MyBroadband published an editorial piece regarding the Department of Basic Education’s choice of programming languages for the high school curriculum (and for the coders who come here, it’s well worth a read). Specifically, the direction seems to be Delphi — this resulted in a storm of comments describing Delphi as “outdated”, “obsolete”, “antiquated” and similar. While those are perfectly valid points, there is something important that those commentators have overlooked.
Delphi is an object-oriented derivative of the Pascal language, created in the late 1960s, and what a lot of people don’t realize is that Pascal (and hence, by extension, Delphi) was primarily created as a language to teach students structured programming. The language lacks features that would make it useful in a commercial/production environment (I certainly wouldn’t use it to pay the bills!), but it’s just fine for teaching basic concepts — perhaps not the absolute best choice (as I’ll go into a little later), but a solid choice nonetheless. True, it’s not what’s being used out there in the Real World, but as the DBE (correctly, in my opinion) puts it, their aim is not vocational training, but “to lay a solid foundation to enable a learner to pursue further education at [a higher education institution] in the IT field”. Delphi, Pascal, and several other languages do just that.
This is something that I can most definitely attest to with my personal experience. I took my first foray into programming with Turbo Pascal, when my age was still in the single figures, and it was the language that I used when I completed high school in 2002. (We were the last class to use Turbo Pascal though, the 2003 class were on Delphi.) I have neither seen nor written a line of Pascal code since, but the concepts taught served me well when I moved on to “Real World” languages (C, C++, C#, Java, PHP and plenty of others). A few years later, when working as an instructor at a private college, I noticed a distinct pattern: the people who had those concepts instilled into them in high school generally handled the subject matter satisfactorily (it was mainly Pascal and Delphi folks filtering though), whereas the people who hadn’t were jumping straight into C#, Java and Visual Basic, and finding themselves well out of their depths.
The last sentence above is worthy of further elaboration and dissection, as a lot of people over on the MyBroadband thread believe Java to be a worthy first language. I strongly disagree, and I’m not the only one. In January 2008, Dr. Robert B.K. Dewar and Dr. Edmond Schonberg published in the Journal of Defense Software Engineering a piece entitled “Computer Science Education: Where Are the Software Engineers of Tomorrow?” (freely downloadable as a PDF here), in which Java comes in for some particularly savage mauling (search the paper for “The Pitfalls of Java as a First Programming Language”). As they brutally put it, Java “encourages the [first time] programmer to approach problem-solving like a plumber in a hardware store: by rummaging through a multitude of drawers (i.e. packages) we will end up finding some gadget (i.e. class) that does roughly what we want”. There’s a lot of boilerplate code that one has to write in Java around a simple “Hello World!” program: there were a few folks over on the MyBroadband thread lamenting the fact that they had to parrot-learn “public static void Main()” without understanding what “public”, “static” and “void” did and, more importantly, why they were important. It’s perfectly fine if you have the concepts already and are using this in a production environment. Not so fine though when you’re learning how to program the first time.
Eric S. Raymond, in his “How To Become A Hacker” essay, makes a point that I find very hard to disagree with:
There is perhaps a more general point here. If a language does too much for you, it may be simultaneously a good tool for production and a bad one for learning. It’s not only languages that have this problem; web application frameworks like RubyOnRails, CakePHP, Django may make it too easy to reach a superficial sort of understanding that will leave you without resources when you have to tackle a hard problem, or even just debug the solution to an easy one.
Having said that however, I have some concerns about the Department of Basic Education’s approach. From the MyBroadband article, it looks like the curriculum will be primarily based on using wizards; I may be a bit old-school, but this approach makes me uncomfortable. To me, it’s just a different type of boilerplate (just a different iteration of “public static void Main()” in a way) — great for production, where time is a factor, but for learning and educational purposes, you want people to know (0) what the wizard is doing, and (1) why it’s doing what it’s doing. Nothing that I read in the original article gives me any confidence that pupils will be taught this.
Finally, while I consider Pascal/Delphi good teaching languages, I don’t consider them to be the best. That accolade, to me, goes to Python. From a beginner point of view, it’s cleanly designed, well documented and, compared to a lot of other languages out there, relatively kind to beginners — and yet, the language itself is powerful, flexible and scalable to far larger projects. Moreover, the language is free (both free as in freedom and free as in beer), which was one of the original requirements of the Department of Basic Education but which seems to have been kicked to the sidewalk at some point. For those interested, ESR has written a detailed critique of Python, and the Python website itself has some very good tutorials.