Before we start learning how to code, let's talk about the process of learning to code. Some people will find this process straightforward. Some will find this process hard. Your experience of this process may be at either end of this spectrum, or it may fall somewhere in the middle. The important thing to know is that whatever your experience, it is fine and normal to feel however you feel about learning to program.
You may breeze through the fundamentals of programming handling these ideas with ease, fully grasping the concept of recursion with barely a moments thought, and ploughing straight through the notions of object orientation as if it makes complete sense. If this is the case, great! However, you may find yourself at 2 a.m. staring at the code for a for
loop wondering what on earth iteration really is. If this is the case, don't panic.
If you're happy with "don't panic" as an explanation, feel free to skip on to the next bit. If you're interested in why you don't need to panic, read on. If you'll permit us a short diversion into educational theory, there's a couple of things to think about that might help reassure you if you're finding learning to program a bit challenging.
If the embed above does not work here is a link to the full version of the video
Threshold Concepts
As with all things academic there is still some debate about the nature of what a 'Threshold concept' (Meyer and Land, 2003)[^ref-meyer-land] as applied to programming really is, but in general these are ideas that tend to be:
- Troublesome - they can be hard to understand or make sense of
- Counterintuitive - they can run contrary to your current understanding
- Integrative - they can reveal links between other concepts and ideas, and may not make sense without those links
- Transformative - they open up new realms of knowledge once they are understood
- Irreversible - once you grasp these concepts you are unlikely to forget them or go back to a previous level of understanding
It is generally understood[^ref-academia] that the field of programming is littered with ideas that fit the definition of 'threshold concepts'. This means that there may be many ideas that you come across while learning to program that you may struggle to get to grips with, that seem to run counter to the way you understand the world, but that once you do grasp them suddenly make everything make sense, that transform your worldview and open up the doorway to the next phase of learning.
I tell you that the field is littered with these hurdles not in an effort to put you off, but in the hope that you will recognise these concepts when you come across them, and that this will reduce your concern. For example: if you are struggling to understand the notion of recursion, it is not that you are unintelligent, but that the notion of recursion is a 'threshold' concept, and it may take some time, some effort, and perhaps some further explanation and reflection in order for you to make the particular breakthrough at which it becomes clear and you can move on.
Difficulties with Learning to Program
There are a series of challenges that a learner must face up to when learning to program. Benedict du Boulay (1986)[^ref-du-boulay] spells these out in "Some difficulties of Learning to Program", and paraphrasing only slightly, they are:
- Orientation - as a novice programmer you are lost not only because you do not know how to get where you are going, you do not know where your destination is and what you can accomplish when you get there. What problems can we solve with programming, and what benefits does it bring us. Why is it worth us spending our time on working this all out, when we don't know what the advantages are?
- Models - as a novice programmer you may not have the mental models that allow you to describe how a computer operates, how a program runs, how the two relate to one another. Your understanding may be compromised by the use of mental models formed from other subjects and past experiences that run contrary to how the machine and code actually work.
- Notation - in order to write code we must understand different levels of notation. Firstly the generic notation that applies to all programming, but then the individual specific codes and grammar that make up whatever programming language we are using. Which notation is generic, and which is specific to an individual language?
- Structures - if we can grasp the notation, what fundamental structures exist that allow us to complete common tasks? What known solutions are there for known problems, and how do we choose between them?
- Systems - how do we problem solve on a much larger scale? If we can write small chunks of code, how do we design solutions to unknown or complex problems and put these solutions together in an efficient way?
The issue with these five challenges is that they are overlapping to some extent, and must often be tackled at the same time. A further challenge is given by the fact that you are tackling these problems at the beginning of a new course, at the same time as you are dealing with everything else that is going on in your life. This can be a significant challenge.
Possible solutions
The bad news: there is no silver bullet. I cannot promise that you will read this set of notes and magically understand programming and all the other things that follow. It might be that this is all it will take, and from here on in you will be an accomplished programmer. However, I think this is unlikely without also doing three other things:
- Practice. Practice. Practice. The magic of coding is that often it becomes easier to understand the more you do it. We will give you challenges to do and opportunities to practice writing code to solve problems, and the more of this you do the more you'll be able to recognise the common patterns, abstractions and algorithms that are a part of successful programming.
- Talk to people. About coding. By sharing knowledge and experiences with one another we are able to put together an understanding that we would not accomplish on our own[^1]. We will encourage this by setting activities that must be completed in groups or pairs and that will facilitate this discussion, but you should also seek it out on your own. If you are stuck on something: ask one of your peers about it.
- Explore the resources you have available to you. We have the entire web available to us, and it is full of information about programming. If you don't like the way we have explained something, or it doesn't make sense, go look elsewhere, and perhaps you'll find an explanation that does work for you. Linking these digital resources will help expand your understanding[^2]
[^ref-meyer-land]: Meyer J H F and Land R 2003 ‘Threshold Concepts and Troublesome Knowledge 1 – Linkages to Ways of Thinking and Practising’ in Improving Student Learning – Ten Years On. C.Rust (Ed), OCSLD, Oxford
[^ref-du-boulay]: Benedict Du Boulay (1986) “Some difficulties of learning to program”. Journal of Educational Computing Research, Vol 2(1) pg 57. DOI 10.219/3LFX-9RRF-67T8-UVK9
[^1]: This is essentially Social Constructivism, another bit of educational theory
[^2]: This is essentially Connectivism, another bit of educational theory
[^ref-academia]: again, as much as anything is ever really understood and agreed upon in education