Teaching Java using Greenfoot to KS4
This blog is a record of teaching Java using Greenfoot to Yr 10 & 11 pupils (ages 14 - 16).
Introduction
We now offer OCR AS Computing to our KS4 pupils as an alternative to the GCSE ICT course. Pupils will study this course over two years; it is normally done in one year by 16-17 year olds but given the excellent students we have here, I think they will cope. Just under 50% of the pupils opted to do this course when they had to make their choices at the end of Year 9. There is no coursework in the OCR AS computing course (which ironically means we will be able to do more practical work as we won't have to jump through hoops).
The pupils are all girls in a high-performing grammar school. They have all had some experience writing code in previous years; they have used Scratch to write a shoot-em game, VB.net to produce a web browser, Logicator for flow charts and html to produce web sites. Pupils on this Computing course will have three 50 minute lessons a week in both year 10 and 11; one lesson is intended to be a pure theory lesson and they will also have a double lesson lasting 1 hour 40 minutes in a computer suite. I expect them to do about an hour or so a week of homework. Pupils will primarily be learning Java. The main IDE we will be using is Greenfoot (excellent and free). We will be working from the Michael Kolling Greenfoot textbook and using resources from the Greenfoot website. We may dabble with other languages and IDEs.
The broad plan for the first year is to program program program by teaching pupils how to write computer games. I intend covering as much of the Greenfoot textbook as possible and as much of the Programming unit (OCR Syllabus F452) in year 1, and then the theory parts (F451) in year 2. By the end of the first year, I want the pupils to be able to confidently write their own computer games.
Thursday, 8 December 2011
So, how has it gone this term and where to next?
The question really is how to move forward from mid February. What I really want to do is go through everything again but in more detail and give them more opportunities to write and experiment with code. We could carry on with BBCBASIC. I like the language but it has limitations, not least of which is the cost for pupils to put on their home PCs if they are to develop larger programs. The debugging tools are limited, too.
I could return to Java but I'm worried! We used Greenfoot. We had a lot of fun using the first five chapters and it really got their imagination going. BUT and it's a big but, chapter 6 onwards was difficult for a significant number of my very bright students (remember, this is a grammar school). Pupils started a bit of chapter 6 and I found they could copy but had little to no understanding of what they were actually doing or why, so they found it difficult to start the first few steps to independence. That's why we stopped and moved to BBCBASIC. Java's syntax is also a lot harder to get to grips with and some of concepts that get introduced from chapter 6 onwards are pretty hard for a 15 year old.
The OCR specification is more geared up to learning a procedural language, which is a problem when you are using an OO language like Java! you can still cover much of the basic programming stuff but talking about top-down design and functions and procedures gets a bit tricky! The other problem is my own weakness in Java. I spend a lot of time trying to get my head around some of the abstract goings-on in Java and then trying to work out how to make it clear to youngsters. There isn't enough time in the week and unfortunately, there is zero help and training for teachers like me during work hours. I have a good set of books, a great set of online resources, some forums for advice, but still - it's hard without someone to sit and explain things and help you work through a problem you have in programming.
Then there is a compromise. I guess I am old enough to be part of the Pascal generation and something like Delphi might be best. The Lazarus IDE is open-source and well supported. We can cover the specification that OCR sets easily. There are some great resources around, particularly on YouTube, and we can easily move on to creating forms-based applications from console-based ones. I've also taught Delphi in the past and am a lot more confident with this than Java. And of course, it will be exciting for pupils to learn a new language and they can practice again all the things they did in Java and BBCBASIC, and then extend those skills.
I wonder if I am too hung up over teaching OO, or indeed any form-based application? I think I'm talking myself into Pascal using Lazarus but need to thing about his over the next few weeks.
What to do to do to do? What to do?
Monday, 5 December 2011
Week 10 - Arrays
New challenges were set around arrays. Pupils were given a program that used an array and asked to comment each line. They then were told the data to use and had to do the trace table for it. Then they had to get some small array-based problems working, extending them as they went.
BBCBASIC is a really good introductory language to use. The more we use it, the more I am impressed. It's very forgiving, pretty clear and uncluttered and there is enough help out there to make life easy. If I had to be critical, I don't think the debugging tools are very good. Pupils really need to be able to step through the code and trace the path, watch variables and elements change. But as an introduction, it's superb and will be part of future teaching plans from now on.
Friday, 25 November 2011
Week 9 - WHILE ENDWHILE and REPEAT UNTIL
I also stumbled across another method of helping them to become more self-sufficient and confident to have a code writing their own code. Although the challenges I set were fairly short and easy to solve, I asked them all to extend each challenge in any way they wanted. So for example, some pupils were confident using CASE so put a menu system at the front of a challenge. Someone else knew how to use an IF statement, so asked the user a question and displayed the answer, if it was right or wrong. Others simply printed things on the screen and changed the text and background colour.
I liked this, not least because by the end of the lesson, they all ended up experimenting with producing different Matrix screens! I kid you not. This potentially boring lesson turned into a lot of fun, as they worked out that by using loops and the TAB keyword, they could produce all kinds of patterns on the screen.
Monday, 14 November 2011
Week 8 - FOR loops and dry-running code
After FOR loops, we will press on with the other iterative constructions. I'm trying to get the pupils to write as many pseudo-code programs as possible and to get used to dry-running solutions. They are getting better at it!
Monday, 24 October 2011
Week 7 - The joys of binary
We used the theory lesson to introduce pupils to the joys of the binary counting system, which was fun. We looked at how denary works and then extended this to binary, doing lots of conversions between both systems. We defined LSB, MSB, bit, nibble and byte and made a few notes on what a character code was, a character set and ASCII. Pupils had to spell out their names in ASCII. We briefly touched on the hex numbering system.
Quite a few pupils were away on trips so I'll have to revisit this anyway but with the next lesson on strings and string manipulation, this seemed like the right time to introduce this topic. Fortunately, they are bright pupils, good at Maths, so we didn't need to labour all of this.
Half term next week so lots of time for preparing lessons (*£&$!). This was a fun site, for making ASCII art.
Friday, 14 October 2011
Week 6 - Forwards we go ...
Today, I gave them all a test. This was the first one on the course and tested a knowledge of a cross-section of the terms we've come across so far. It lasted 25 minutes. I've just marked them and interestingly, I'm failing half a dozen as they just aren't getting the basics clear in their heads. Most, however, are doing staggeringly well. I'm both delighted and relieved that the knowledge is going in for most of them. Next week, I will work closely with the six who are struggling whilst the others get on with their pianos and see if I can help them with some of the basics. I also need to arrange 'Study buddies' for them, other students who can help them revise and who they can ask for help. This idea works well in a Grammar School. On the plus side, they all completed a questionnaire on all aspects of the course so far. Nearly everyone is thoroughly enjoying the course. Most love the challenge, although a few are struggling. They like the resources, the pace is good for most of them and all but one person thinks they are really learning something useful. This is very encouraging but I must work harder to get the ones who aren't so happy back in the groove!
We also did our first introduction to pseudo-code today. We talked about why programmers need to define problems exactly and we looked at an example. I gave them a problem and then asked them to write down the steps in solving it in any way they wanted. After a while, they were stopped, and we looked at their solutions, finding ambiguity as we went. I then showed them a solution in pseudo-code and we discussed that and why it was precise (nearly) and what we needed to do to improve it.
This was really interesting, watching them thinking and discussing how to clearly describe a solution to a problem. I have a feeling that they are going to benefit from practising using pseudo-code to define the solutions to problems in all kinds of unexpected ways. If nothing else, they should after a few weeks start to think more logically, step-by-step, trying to pick holes in their own solutions. I'm quite looking forward to the next few lessons.
Monday, 10 October 2011
Week 6 - Things just got harder, and easier ...
So, while I figure out how to deal with this, we are going to spend a month or so with BBCBASIC as well as introduce BlueJ for Java. Our syllabus requires us to look at a procedural language. The plan is to set them lots of small, focussed problems and get them expert in producing pseudo-code in constantly mixed-up groups. Then dry-run the pseudo-code, showing them how to do that and produce test plans. Then they will have to implement the code in BBCBASIC and finally, implement the code again, but this time in Java using BlueJ. Hopefully, looking at BBCBASIC as well as Java will drive home some of the more basic ideas: variables, constants, selection and iteration, arrays etc. This might make life a bit easier when we return to a world made up of objects and classes (or it might confuse them - we shall see). If nothing else, we can tick off lots of bulletpoints in the syllabus in the next four weeks and that can only be a good thing.
This week, the plan then is to get them all closer to having a finished fun piano, then start working through the tutorials in the BBCBASIC application. It has been donkey's years since I looked at BASIC, but it all came flooding back on Sunday.