The benefits of learning to program are even more convincing. The sense of pride one gets from writing working code and the triumph of resolving errors are rewarding in themselves. Factor in the colossal role of technology in today’s world – let alone tomorrow’s – and the case for teaching computer science looks as compelling as Google’s credit limit.
But there is a deeper reason for studying the languages of computers - one related to another of Dr Schmidt’s recommendations: that we bring art and science back together.
So long have these two lovers been estranged that the thought of a mathematician writing timeless fairytales, or of a painter inspired by geometric proportions, is inconceivable to the modern schoolchild, who sees specialism as the sole road to success.
On the face of it, maths and languages may seem quite different. But beneath the surface they surge with a common current. Learning to use the mathematical languages of computer programs can reveal how much the two disciplines complement each other, and demonstrates that logic is not limited to science, nor is art the only harbour of elegance.
To truly know a language, one must master the rules and structures that make it work: its grammar. Learning this advanced logical apparatus propels one from a pool of phrases to a stream of fluency. The more grammatical constructions a person can use, the greater the range of expression available to him (and the greater his ability to understand the expression of others). Moreover, once you have grasped one language’s grammar, learning another’s is easy; even with languages from different families, the logical mindset acquired from studying the one will be of great help with the other.
All this is just as true of computer languages. But there is one key difference. Though it is possible to speak or write a passable piece of English or French with minor grammatical errors, a single mistake in software code can be disastrous. A computer cannot “get the gist” of what you are telling it. The instructions it receives must adhere strictly to the rules of the language they are written in.
Pupils who have learnt to write computer programs are therefore likely to approach both their native language and foreign languages by arming themselves with a thorough and accurate understanding of their grammar. The consequences of illogic and imprecision in their code will give them a keen eye for the same flaws in their writing.
Thus they will see how logic and accuracy (qualities more often associated with the sciences) can make them better writers and linguists.
But programming isn’t purely about precision. Good code must be graceful as well as accurate. A well-written program – like an elegant piece of English – is one that conveys its meaning clearly and effectively. It avoids tautology and repetition, which increase the capacity for mistakes. It is as concise as possible: the less code there is, the easier it is to spot and rectify any internal illogic - and, in general, the fewer instructions a computer has to execute, the more quickly the program can run. It uses meaningful words rather than abstract ones, in order to make its operations clear.
In other words, good code adheres to the golden guidelines for good English set out by George Orwell, the Fowlers and others. Ugly code might function correctly, but it will be less valuable, more difficult for other programmers to understand, and harder to fix and modify when doing so becomes necessary. It will certainly not gain the admiration of one’s peers.
As pupils become better programmers, they will see that elegance (a quality more often associated with the arts) is as vital as accuracy to writing good, effective code.
Dr Schmidt’s suggestion is ambitious. Programming is no easy skill to master - for teachers or pupils. But it is worth it: for its own sake, and also to dispel the myth that maths and languages are mortal enemies, that logic and style cannot coexist. In doing this, learning to code can help to renew that star-crossed marriage between science and art, which gave the Mona Lisa her smile and took Alice into Wonderland.