Teaching Programming: Modern or Educational?

Keeping education “up to date” is an interesting topic. Too far behind and you’re an irrelevant dinosaur, too close to the front and you’re chasing fads. Universities suffer a lot with this in computer science. Students often want to learn languages which are applicable in industry: C++, PHP, Javascript, Java. They feel that learning these will give the best immediate chance in the job industry once they graduate (and they’re not necessarily wrong). On the other hand, the university wants to provide an education that teaches long-lasting principles, and they want to stay away from languages that are hard to teach to beginners (such as C++). This is why Java has managed to be popular for so long: not too difficult to teach, but used in industry.

School-level non-vocational education is slightly further removed from the job-seeking concerns of students, but it still has similar tensions. Even the most principled of subjects can slowly change over time. English grammar slowly evolves, and schools can get caught teaching old principles (e.g. forbidding students to ever split an infinitive). Maths slowly moves on: why do we still teach long division when no-one would ever use it in real-life?

iPads in the classroom
iPads in the classroom — an educational fad, or moving with the times? Photo by Brad Flickinger, CC BY 2.0

Programming is an interesting example of a field that is moving forwards all the time — how can educators pitch the level correctly to avoid chasing the latest fad, while not being left behind, teaching outdated topics?

I think there are two main reasons that school-level programming education is in danger of teaching outdated items. Firstly, there is little funding or time for teachers to update their knowledge, so many teachers will therefore tend to stick with teaching what they learnt themselves (which may be many years before). Secondly, over time programming over time tends to grow more complicated, so older content is often simpler content, and thus more suitable for teaching. But I wonder if there is a danger of falling into the trap of the man searching beneath the lamp-post for his keys because that is where the light is: is there a risk of teaching what is easy to teach, rather than what is useful? A good example of this is binary, which I believe is no longer much use outside hardware — but it’s well understood how to teach binary, it’s achievable for school pupils and somewhat fun, so we keep on putting it on exam syllabuses.

Original photo by quimby, CC BY-NC-SA 2.0
Original photo by quimby, CC BY-NC-SA 2.0

Laura Dixon’s recent post made me think about these issues again. In summary, the OCR AS-Level syllabus has a few items that are problematic to teach in Python, such as repeat-until loops and arrays. Repeat-until loops are pretty much dead in modern programming — so much so that Python omits them. That’s a fairly small issue, but an example of the sort of problem that can arise. Arrays are still in Python, but most (non-C) programming has moved on to things like collection classes in Java, or list types in things like Python and Haskell. But arrays fit very well educationally with other topics of that level: using an integer counter to loop through array indexes works well with topics such as loops and integer variables. Nice to teach, but generally outdated in modern programming (where for-each loops or higher-order functions like map are the order of the day).

I’m not saying that this means we shouldn’t teach arrays, just that there is a clear tension between teaching considerations, and modern programming practice. Another example, which briefly crops up in the OCR spec, is ASCII. ASCII is dying, replaced mostly by its vastly more complicated superset, UTF-8. But UTF-8 would be crazy to teach in full, with all its byte-stuffing practices that mean different characters take different numbers of bytes, and all the combining characters and normalisation and so on. ASCII has the fundamental idea of characters-as-numbers, which is a useful (and timeless) principle, even if the exact encoding itself is getting more complicated.

Photo from Phil Gyford, CC BY-NC-SA 2.0
Computing in the classroom, 1983. Photo from Phil Gyford, CC BY-NC-SA 2.0

Programming paradigm is also another interesting choice. In the late 80s, procedural programming was predominant. Languages like C were ascendant in industry. Pascal was a great educational mirror of the status quo: an easy-to-teach procedural language, covering the most important topics such as if-then, loops, records and subroutines (and Pascal even saw some use in industry). By the mid 2000s, object-oriented programming had won: C was still around, but C++ and Java were the new thing, and Microsoft were responding with C#. Universities did respond to this: Java became the new top teaching language at universities (and still is). Right now, functional aspects are on the rise. It is not necessarily purely-functional languages — instead, languages such as Python, Ruby, C#, and even slow-moving Java, are adding in concepts such as higher-order functions, first-class functions (or closures, or similar).


So where should school teaching pitch its tent? Should it stick with traditional procedural programming — or should it include some object-orientation, or even some functional programming? There is a tension: a temptation to catch up to the modern world of programming. You’re dead if you’re not functional in 2013! But I think it is worth remembering that the educational pipeline for a modern UK professional — for better or for worse — involves school until 18 and three years of degree afterwards. We don’t expect school children at 16 (or even 18) to know enough maths to move into disciplines (e.g. actuarial work) that involve mathematical knowledge, so is it reasonable to think that school children at 16 should be able to go straight into being professional programmers? If we do succeed in getting computing back into schools, a long-term challenge will be trying to organise computer science education into a cohesive pipeline, like maths, that avoids repetition and builds to a useful, relatively timeless, conclusion.

4 thoughts on “Teaching Programming: Modern or Educational?

  1. I’m not sure I agree about binary. You can’t teach the limitations of computer arithmetic without binary, so should you just state ‘Never compare two reals for equality’ without any sort of explanation?

    I know it’s not programming but I’ve just taught Gray codes, which don’t make a lot of sense without pure binary, and linked it in to using XOR on the bits of the binary. Without binary ‘in the middle’ you can’t join the concepts up: one of my hobby horses is the way that we can end up teaching a lot of separate subjects without exploring the links between them.


  2. Floating point is one exception I mention in the binary post, but I think it’s a relatively advanced topic — and, as a thought experiment, I wonder how much you could do without binary per se. I think you can teach the principle of why equality is a dodgy idea without binary (e.g. look at sqrt(2)^2 in decimal with finite decimal places), and why 1/10 recurs in binary is the same principle as why 1/3 recurs in decimal. Similarly, the principle of mantissa and exponent are explainable in decimal — although the trick of omitting the leading 1 is binary-specific (but not very important?). I guess my question is: if you weren’t teaching any hardware, could you make it to the end of A-Level without covering any binary?

  3. A quick 2p worth of comment from the perspective of maths education. Whilst visiting secondary schools in the past 12 months it was a sobering experience for me to reflect that there has been no significant impact of technology in the maths classroom since I first got involved with maths education and technology 20 years ago!! We have barely got to a sensible position about the use of scientific calculators, and graphical calculators are hardly anywhere. Let alone computer algebra systems, and computational mathematics (algorithms, numerics). Delving into the literature of the mid-80s turned up so many papers and reports saying that computation would not fail to revolutionise the maths curriculum within a few years.
    For me, the biggest barriers to change in mathematics in England are in assessment. Assessment has not changed and shows no sign of significant movement (I am not counting doing multiple choice tests on computer terminals). The exam boards have a total grip on the system – an unholy alliance exists between exam boards, schools, and parents, which cripples innovation (this is not just hearsay – people have done systematic research on how the spirit of the math national curriculum revision of 2008 was crippled by various parties).
    For me looking at computing/ICT, you should be in a much better position to achieve change as the vested interests and unholy alliances are in a far weaker position. Assessment by significant projects is widely accepted, which opens up curriculum possibilities. I agree with Neil that working out what needs to go in the ‘developmental pipeline’ is the key area for investigation.

  4. I agree with your conclusion that the purpose of school education is not necessarily to place students straight into advanced jobs. Having just come out of the local FE system (and I taught programming in Uni in the 90’s to Engineers) my feeling is that breadth rather than depth is required (the brighter/more interested student can always do homework, or get their private tutor to help). My daughter teaches Chinese and a big part is culture, computering has come a long way and there is plenty of scope to make the subject more interesting – eg Greenfoot has many addons: picoboard/kinect/robot for a start. In particular I would really really bump up group work (particularly for boys) way back when I studied Double maths at A level the primary skill, I remember, was individual problem solving (I am not saying that we did not try and collaborate but ..). In my current position I see too much diffidence from young people, maybe its the austere times.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s