Programming in (Pre-University) Education: Don’t!

Johannes Waldmann, December 19, 2018

Summary: Programming should be taught to aspiring programming (software engineering) professionals. Any other such teaching, is, at best, misguided, and often actually harmful:

  • It tends to detract resources from where they are really needed, namely, teaching fundamentals.
  • It tends to hide the fact that software platforms used in teaching programming tend to use, or to be, mechanisms of surveillance capitalism.

This statement was prompted by messages on the Haskell in Education mailing list, but my claims and arguments are not specific to any one programming language. In other words, on “Haskell Programming in Pre-University Education”, I still say “Don’t.”

And, of course, none of this shall be construed to be the opinion of my employer.

How I Do Teach Programming (to Software Engineers)

As a professor of computer science (CS), I regularly teach courses in the curricula for CS undergraduates (studying for the degree of Bachelor of Science) and CS graduates (for Master of Science). My institution is actually Fachhochschule, so we are really producing software engineers, not computer scientists. But, of course, engineers learn to use scientific methods. And I want to emphasize: this “engineering” is no way inferior to “science”. Our teaching is rigorous, and we do have bright students that would fare very well as scientists.

Now, here’s the language specific part: I think I know Haskell quite well. I started using it around 1992, for my PhD research on Combinatory Logic, with hbc, gofer, and ghc-0.29. Yay! At that time, I was also a teaching assistant, using Ada, and Hoare (wp) Calculus. These days, I am using Haskell pervasively in research and in teaching: in my 4th semester (required) course, students learn fundamentals of declarative programming (see How I Teach Functional Programming, WFLP 2017), and in other (optional) courses, I build on that, using Haskell as a modeling language, and implementation language (e.g., in Compiler Construction), and as a host language for embedding domain-specific languages (as libraries), e.g., in Constraint Programming, and Computer Music.

What About Teaching Programming to Others, or Earlier

I am firmly of the opinion that any other teaching of programming (than at the professional level) is harmful because it tends to detract resources from where they are really needed: in the teaching of fundamentals.

Pupils should learn and do, in some reasonable mixture, mathematics, music, their mother tongue, other languages, physical education, history, physics, chemistry, biology, and so on.

There is no need to include “programming” here. I don’t see what could be learned from it - that would not better be learned from mathematics, see below for more detail.

Even if “programs are everywhere” today, that’s not enough reason to teach programming. There are cars and washing machines “everywhere” (that is, in most households), but this does not mean that “cars” or “washing machines” should enter the curriculum as independent subjects of study.

Certainly, at the right time, these topics could and should be used as examples to illustrate thermodynamics, internal combustion engines, electromagnetic force, accumulators, soaps and detergents, plumbing, sewage treatment, and so on.

A Topic That Needs To Be Taught Early

Well, there is one thing that is specific to the role of software in today’s society: pupils must be educated about what data they produce when “using” online services, and how their data is siphoned off and monetized - and how the beneficiaries of these processes try to adjust society’s perceptions and rules in their favor.

Understanding this requires no knowledge of programming, but of market, and political forces.

About Assigning Resources

Politicians like to appear “modern” by throwing money at buying hardware and software, in the hope that parents (which are voters) fall for it.

E.g., this is currently happening in Germany with the federal “Schuldigitalisierung” initiative, cf. (FAZ, 22 Nov 2018) Heading: “Government plans: each school shall get 25000 EUR for tablets and laptops”. See below for “tablet”.

This initiative is currently stalled due to fights between federal and state governments - about who gets to decide how to spend the money. Of course not about whether buying tablets is a reasonable goal.

Simply, this money would best be spent not for “Digitalisierung”, but for hiring teachers, and improving their salary and working conditions - in other words, for helping schools and teachers do what they do best.

This “extra money” is already missing in the schools’ accounts. It is never “extra”, as there always was a reduction in funding before. This more or less forces schools to apply for those funds. They will play the game, in the hope of finding a way to re-allocate at least some of it towards reasonable goals. At least that’s the least bad outcome. Is it?

How Programming Actually Will Be Taught In Schools

This is in no way a criticism of the teachers. They really don’t have a choice.

If the funding money materializes, and it cannot be spent on reasonable things, then the following will happen: it will be spent to buy specific hardware (tablets, see above), running one specific operating system (Android), with one specific browser (Chrome), or some App downloaded from one specific App Store (Alphabet’s). Each of these software systems is just one thing: a surveillance mechanism.

Even assuming that the primary goal of surveillance is “just to make more money from selling advertising space”, and noting that Alphabet isn’t the only company in this game - this is all very far from harmless. Platforms are known to create addictive behavior (by using interaction patterns that increase exposure to advertisements) and there are plenty of actors with secondary goals, and a high risk of mis-use.

Add to that “online teaching environments” that require pupils to create an account with some external provider, and be logged in to that account whenever they are using the device. Sure enough - a lot of providers want to have a piece of that cake (of data). They may even want to give away the service “for free” in exchange.

“Algorithmic Thinking” and Scientific Thinking

I repeat: there is no inherent value for society in teaching children to program (early, or at all). Or, there’s nothing that would put programming into a place superior to architecture (planning and building a house), or musical composition.

Well, we don’t generally build houses in school (because that’s a subject reserved for civil engineers), so we don’t need to build programs (that’s for software engineers). But perhaps there’s value in training children to at least “think algorithmically”? That is, without actually writing and running concrete programs on concrete machines, and spending resources for that.

No! Because such a “thinking” does not exist. No-one can sufficiently explain what this kind of thinking should be, and how it would be different. (I am citing, from memory, an argument made in some letter to CACM, probably an response to A New Perspective on Computational Thinking that I am unable to locate now, and I cannot use their web site since they seem to require tracking JS from google[apis].com)

There is logical, scientific thinking, which we recognize because it uses exact syntax and semantics for statements and proofs, and claims can be verified, or falsified. That’s the “thinking” that needs to be taught.

There Are Enough Algorithms in Mathematics Already

Certainly, this scientific method can be exercised with the discussion of algorithms. But we don’t need any extra inventions for that - as there are plenty of algorithms in mathematics already - and they have been there for hundreds, sometimes thousands of years. Start with long multiplication, long division, add criteria for divisibility, and Euclid’s algorithm. And run these on paper!

That is, write down the numbers - or, for Euclid, don’t even write numbers, but use two lengths of paper tape, and subtract the shorter one from the longer one (align, and cut with scissors). CS unplugged should have an episode on that. Do they? I am checking their web site - turns out their search engine has nothing on Euclid. But they do have (some) “programming challenges”. Well that’s quite a change from the original “unplugged”.

More on geometry. Lead pupils to the wonderful land of construction by ruler and compass. It cannot get more algorithmic than that! Includes ample opportunity to discuss algorithm design (how can we construct the midpoint of a circle, given only its outline), correctess (why does this indeed give the midpoint), and, if you want, efficiency (how many steps did we take). Even more - we have impossibility results: the diagonal of a square is incommensurate with the side (i.e., Euclid’s algorithm won’t stop), we cannot trisect an angle. Sure, the proof of that will be out of reach. It took mankind a few hundred years!

But algorithms are everywhere in mathematics, because each proof is an algorithm - that produces evidence. (An inductive proof is a recursive program, etc.) Yes, strictly speaking, this only holds in constructive logic. But even a proof by contradiction is an algorithm that produces a contradiction from a contradiction.

The summary of the above: teach mathematics, and the scientific method, in school. Leave programming where it belongs: in professional education, of professionals. It is just one profession, after all.

Can Programming Help Mathematics? Pocket Calculator Says No.

Still, the question remains: the current climate seems to favor allocating resources (time in the curriculum, and money) towards programming, and it will take some time to change this. What to do in the meantime? The really hard question is whether this (wrong) focus on programming can be made to work to help mathematics education.

I don’t have high hopes for that, with the following anecdotal evidence: We have seen in Germany (at least in some federal states), about two decades ago, a focus on introducing pocket calculators (with minimal capabilities in graphics and computer algebra) into the mathematical school curriculum. Of course, manufacturers loved this. (Casio loved it so much they sponsored a professorship for didactics of mathematics at Jena University.)

Some teachers had high hopes (or just played ball) but effects were devastating - as we observed for students entering our department. They could no longer do elementary arithmetics (neither numerical nor symbolical), could not sketch a curve on graph paper (what’s graph paper?) or do any back-of-the-envelope estimate - even with a calculator.

And what’s worse: since curricula were changed irrevocably, teachers that recognized the problem weren’t even allowed to repair it because they had to prepare their pupils for the pocket-calculatory exams prescribed by administration.

Needless to say, in my exams, I rule out any automated computational devices - and tell students about this early on.

Sure, the decline of high school maths may have some more reasons. It’s a never-ending topic for DMV (German Mathematicians’ Association), cf. – Summary of first paragraph: “Universities complain that basic mathematical abilities of beginning students are insufficient for a lot of courses of studies. Ministries of Higher Education complain about STEM students dropping out of university. Industry complains about insufficient mathematical knowledge of university graduates.”

I don’t think any of this will be improved by emphasizing programming - which will invariably de-emphasize mathematics as a side effect.

But …

But here’s a business idea: ghci for FX-CG50, anyone? Watch out - they do have Python already!

And there’s no Wireless module - at least, the factory web site does not mention it, while I’m sure they would. So, no third party JS? No JS at all! I’m tempted to support the idea …

Version history

  • December 19, 2018: add paragraph on geometric algorithms
  • December 18, 2018: initial