Adventures in Teaching Kids How to Code

RSS

Rik explains: encouraging learners to collaborate in Scratch

Rik Cross is the Interim Head of Content and Curriculum at the Raspberry Pi Foundation. He also runs a Code Club and is a former secondary school teacher. So he has a wealth of knowledge about all things Code Club and Scratch, which he shares with you in our blog series ‘Rik explains’.

Today I’m going to talk about some of the ways in which you can use Scratch to encourage collaborative programming in your Code Club. I’ll first discuss some general approaches and then give you examples of practical activities to promote collaboration in Scratch.

Approaches to collaborative programming

Pair programming

Pair programming is exactly what it sounds like: two learners program together! Usually, one learner takes on the role of ‘driver’ and writes the code, while the other learner is the ‘navigator’ who observes, reflects on, and reviews the code as it’s written. Pairs swap roles regularly, say every ten minutes.

As paired learners need to discuss the code before writing it, they are automatically encouraged to think logically and discuss solutions. They are also less likely to produce bugs, but if they do, discussing with each other will help them to debug their code more easily.

It has been shown that pairing more able and less able learners is of benefit to both: the less able learner sees how a more experienced programmer approaches and solves problems, and the more able one learns how to explain solutions in a clear and understandable way.

It’s also worth noting that this approach works best when learners collaborate on a project about a shared interest. This means that with some forward planning to decide on who to pair up in your Code Club, you will maximise learning.

Remixing

Collaborative coding can also happen remotely in the awesome Scratch online community! Learners can take online Scratch projects and change, personalise, and expand them. This is called ‘remixing’ (and it works with or without a Scratch account).

To remix a project online, simply log in and click the ‘Remix’ button in the top right-hand corner of the Scratch editor to create your own copy. (To remix without a Scratch account, download the project to your computer instead.)

You can see who is remixing your projects on your main project page:

One benefit of remixing is that it allows a learner to start with a project containing some more complicated code. For example, they might find a platform game project in which the code to handle player movement has already been written. This allows them to focus on things like designing levels, adding sounds, and creating custom graphics. As they become more experienced, they can look back through the original code to discover how to program the more complex features of the game. Being able to understand and edit existing code is an important skill to learn — professional developers share and re-use code all the time.

There is a great set of community guidelines that learners should read before joining the online Scratch community. One important piece of guidance is: “Be sure to give credit when you remix”. A good way you can teach this is by encouraging your learners to use the ‘Notes’ section of a project page to thank and give credit to others.

Activities to encourage collaboration in your Code Club

Custom blocks

A perfect time to encourage your learners to work collaboratively is when you’re showing them how to make their own custom blocks. Scratch allows learners to create their own blocks, which they can even pass data into. The example below shows a simple draw square custom block that is used twice to draw two different coloured squares.

One of the many advantages of custom blocks is that you can use them for decomposition, meaning you can break down a problem into smaller sub-problems and tackle each one separately. In the example, once you’ve created the draw square block, you’ve solved the sub-problem of drawing a square and don’t need to think about the block’s inner workings anymore. Another advantage is that once you’ve defined a custom block, you can use it as many times as needed. This means that if you, for example, want to draw larger squares, you only need to make one change to the block code, even if you’ve already used it to draw lots of squares.

If you’ve never worked with custom blocks before, you can get started by using our Binary hero project.

To highlight the power of decomposition for your learners, you could divide them into two groups. Then you can task one group with specifying the customm blocks needed (meaning the sub-problems to be solved) and creating the main code that pulls everything together. The other group has the task of creating custom blocks to solve the sub-problems. They can test each of the custom blocks separately before adding them into the ‘main’ Scratch project.

Crowd-sourced projects

Another way of encouraging collaboration in Scratch is inspired by the “Add yourself…” projects (such as the excellent Add Yourself to the Race!). These are crowd-sourced Scratch projects for which community members create sprites that are each coded to respond to messages that are broadcast in the main project.

Start this activity by deciding with your learners what the theme and the rules of the project should be. For example, you might like to work on a dance project in which learners can create sprites to have a dance party together. The moves to be broadcast could be:

Move left

Move right

Jump up

Crouch down

Make some noise

Once you’ve all agreed on the theme and the rules, you, or one of your groups, create the Scratch project with the broadcast commands, where all the sprites will be brought together in the end. For the dance example, I’ve created a project with a list of ‘moves’, with one of the moves being broadcast at random every time the music loop is played. (This will ensure that the dancing stays in time with the music!)

Learners can then create their own sprites that respond to the broadcast dance moves. For example, here’s a sprite that’s been coded to jump whenever it receives a ‘jump’ message:

To combine the different sprites, each learner can save their individual sprite and then upload it into the Scratch project containing the code to broadcast commands.

This activity allows learners to collaborate while still working at their own pace and ability level. It also allows them to be creative in how they fulfil the task you’ve given them. Plus, it’s really fun to see all of the sprites together at the end of the activity!

Check out the Code Club projects

Looking to find out more about what running a Code Club looks like? The best place to start is by checking out the Code Club projects, our free, easy-to-follow learning resources you can use to teach young people Scratch, HTML/CSS, Python, and more.