Teach Concepts Not Just Code
Written by Mike James
Thursday, 31 August 2017
Article Index
Teach Concepts Not Just Code
Math, Not Arithmetic

## Math, not arithmetic

Well we have to avoid the standard mistake that occurs in the world of math education.

Most math teachers and mathematicians confuse math education with arithmetic. It isn't. You can do math even if you can't actually do arithmetic.

You have to know how to do arithmetic but it really doesn't matter if you can't add up accurately. We probably turn lots of children off math simply because we insist on teaching it after arithmetic and by tying success in math with an ability to do arithmetic and memorise tables.

This is a terrible shame.

If you want to make up for the lack of skills performing arithmetic then buy a 50 cent calculator. If you want to make up for a lack of mathematical skill then, at the moment, no amount of money will do the job.

When it comes to programming, it is vital that we don't make the same sort of error.

We do need to use a programming language to teach programming, but what we are teaching is not the language but the concepts that give rise to the language.

We need to teach loops and conditionals, variables, counting, flags, representations, states and eventually objects, methods, properties and so on. This isn't about making a choice that object oriented is the way to go - it's is about teaching that sometimes it is a good idea to tie data and the procedures that make use of it together and sometimes it isn't.

Above all we need to realize that teaching the language syntax and displaying example programs is a means to an end. It is not about being able to reproduce the syntax of a statement from memory.

Leave the tough rote memory stuff for later.

After the algorithmic way of thinking has started to settle in you can go for the interesting stuff. You can tackle parallel programming and the wonderful ways it can go wrong - race hazards, synchronization, dead lock, starvation and so on. You can leave recursion for when young programmers are old enough to see an x-rated topic - or you can introduce it as just another flow of control form, it is up to the taste of the teacher and pupil. We don't have to agree on the importance of every concept. The same goes for type and the functional approach to computing.

## The discipline of debugging - science in a can

Then there is the wonderful art of debugging.

It is science in miniature. You state your hypothesis, make a prediction and check that it is so. When you find some part of your program that isn't doing what you predict, then you know your theory, your understanding of the way the program works, is wrong - and you have your bug. What could be deeper or more philosophical than to put the scientific method to use over and over again.

Debugging isn't about making programs work, it is about making use of a deep understanding of algorithms. An understanding so deep it can be used to predict the state of the system at any point in the programs execution and seeing what could cause the difference if prediction and reality don't match up.

Learning to debug is the highest achievement in applied algorithmic thought and not everyone can do it.

## Not Just Code

Finally it worries me that many of the attempts at starting "learn programming"  websites, courses and other resources seem to be based on the premise that you simply teach a language.

It also worries me that many of the people behind these efforts really only seem to know a single language. They might know it well, but as you might begin to understand by this point, this isn't enough.

Many of them seem to be committing the sin of teaching arithmetic while claiming to be teaching math.

Don't let this stop you from trying your hand at teaching, however. If you want to do the job well, always try to understand why your pupil made a mistake. Dig deep and don't assume that it is just because they misunderstood the syntax - this is usually a signal that their internal model is slightly wrong. Investigate your own internal model and see what differences in their model that could produce the misunderstanding. See - I told you knowing how to program and algorithmic thought was important and general. This is real debugging!

Always teach concepts and not just code.

#### References

M. James, "Computers and routes to learning", Bulletin of The British Psychological Society, 32 (1979), p. 420.

What makes a programmer

 DevToys 2 Now Cross-Platform18/07/2024DevToys, a bundle of tiny tools designed to do quick, specific tiny tasks, has been updated with a cross-platform version supporting Windows, MacOS and Linux. + Full Story Amazon Announces Updates To Bedrock and MemoryDB23/07/2024Amazon Bedrock and MemoryDB have been improved according to announcements made at Amazon's recent AWS Summit in New York. + Full Story More News