Welcome to Coding Corner-this is a column about computing and coding. Written by Dan Aldred (@Dan_Aldred) who is well worth a follow on Twitter. Dan’s article is about Programming Student Interest
Many teachers jump straight into teaching students code. They log on, load up the interface and start typing out lines of code. Those students, who can copy from the board, do so and are successful. For those students who can’t or who miss a part of the code, then the program fails and some students are just turned off, straight away. The key to enabling students to learn to code is getting them interested and teaching them to think about what they want the program to do before they start coding.
When first introducing programming, it is useful to get students to notate on paper how to direct a student around the tables in a classroom. It is good fun and gets the students thinking about the commands they need to create and when to use them. More able students can be stretched by allowing them only ten instructions or only the use of a whistle. A remote control car is great for lower ability students to develop the concept of control and getting them to plan what turns they will need to make and in which order,to direct the car accurately around a course.
A paper lesson starter is this quiz, http://www.tes.co.uk/teaching-resource/The-Quiz-6260250. If the student follows the instructions then fine, if not they will be asked to carry out silly tasks. RoboZZule requires students to program a robot through various challenging mazes to collect stars, http://robozzle.com . Tower times have some great simulations of the roller-coaster at AltonTowers. Students can program them to get the ride operational.http://old.towerstimes.co.uk/media/games.htm.
These activities get the students thinking not just about the end result but the steps required to get there and this is the key to understanding how to program well. Students need to understand what steps the program needs as well as how to code these steps.
Teaching students to understand what they want to program is as important as how to program it. It reminds me of the Christian aid slogan, “give a man a cow and he will feed his family for a week, give him the tools to farm and he will feed a village for life”. Give a student some lines of code and they will copy it for that lesson, teach them HOW to code and they will develop their own programs.
For example, a simple beginner’s code such as print “hello world” can be copied and typed in easily, but if the student understands what the print function is doing then they can print anything. Suddenly students are displaying anything they want. Print “I like maths!”. Further still, it enables students to think through a solution.
We all use a password to log into a computer, how does the computer know the password is correct? I could just give the students the code, but better is to get them to understand what is happening behind the screen! This is where the previous activities can begin to develop thinking and planning skills.
The user enters their password.
The password is compared with a stored password.
If they match the computer logs the user on.
Now you can teach the student how to perform each of the above steps, so if I want to allow a user to enter a number into the computer, then I need to define a variable. A variable is like a storage box, I do this in Python with the simple command x = input, x is the number that the user enters in. Then I use a prompt to tell the user to enter the data, x = input(“please enter your password”), the students have learnt how to enter a password, but more importantly how to enter and store data.
Now students know how to enter and store a variable. The next question I usually get is, how do I enter and store text and letters? Already the students have taken the concept and applied it to a password that contains text. They are beginning to learn when to use the code rather than just a set of commands or program lines.
This approach helps to develop students programming skills as well as maintaining their interest. The next hurdle is helping students to remember the code!