An Introduction to Scratch

Mar 15, 2021

Miles Berry

The example programs in my previous post were built using Scratch. Launched publicly in 2007 by the Lifelong Kindergarten group at MIT’s Media Lab, Scratch might be credited as having done more to make programming immediately accessible to primary and lower secondary age pupils than any other language or tool. Scratch programs consist of one or more ‘scripts’: sequences of instructions (including repetition, selection, input and output commands as needed) that are executed in response to particular on-screen events, such as clicking the script itself or a green flag icon. The scripts control the actions of one or more graphical characters, called sprites, on a stage. The characters can have interchangeable costumes, and the stage shows one or more backgrounds, which again may be controlled by programmed scripts. The dramatic metaphors of characters, costumes, stage, background and scripts are intentional, making the meta-language of Scratch familiar to pupils, and naturally leading to creative projects in which pupils can create their own scripted animations of stories.

the Scratch programming environment with an example maths quiz game

Figure 1 - the Scratch programming environment with an example maths quiz game

Mitch Resnick (2017), founder and director of the Lifelong Kindergarten Group, states that Scratch has, metaphorically, low floors, wide walls and high ceilings. These three dimensions go some way to explaining Scratch’s phenomenal success as an introductory programming environment, both within and beyond school.

Low floor

Scratch does much to make programming immediately accessible - inspired by Froebel’s gifts and LEGO bricks, Scratch programs are built, rather than written, by snapping together colour blocks which represent the commands of the programming language. The command blocks can only fit together in a way which makes sense in the formal structure of the language. Thus, whilst it’s possible for the programmer to make errors in the underlying algorithm for their program, or in translating this into the formal language of Scratch, they cannot make the syntax errors (spelling or typing mistakes) which are a common experience of coding in text based languages such as Python and Logo. Furthermore, the program blocks are all visible to the programmer, and thus there is no need to remember the commands available, although familiarity with the command blocks certainly makes programming in Scratch easier.

Programming in Scratch is also made more accessible through its immediately visible effect. Scratch programs typically cause the characters to move, draw or display text on screen, and thus there’s instant feedback on what a particular script is doing. Similarly the value of Scratch variables is, by default, shown on screen, making it easy to track how these values change as a program runs.

Scratch has support for many human languages: the globe icon allows the default English to be swapped to one of many other languages, and so those whose first language is not English can quickly understand the idea of a command or script in their mother tongue:

Scratch program to draw an equilateral triangle in Korean

Figure 2 - Scratch program to draw an equilateral triangle in Korean

Wide walls

Scratch’s developers recognise that there can be many different paths from novice to mastery in programming, and that there is great value in responding to young people’s own interests rather than limiting their experience of programming to one particular area of application. This makes Scratch a good choice for those interested in exploring a range of different digital media for programming projects: Scratch can be used effectively for scripted animations and digital storytelling, but also lends itself to playing recorded audio or musical compositions, to creating on-screen art and interactive video games. A good primary computing scheme of work should give pupils some experience of working computationally in all of these media.

Whilst Scratch comes with an extensive library of background images and costumes for its sprites, it also has a flexible image editing tool built in, allowing pupils to create their own images as backgrounds and as costumes for the programmable characters. Some computing teachers express concern that spending a long time on graphical elements such as these detracts from a focus on developing computational thinking and programming, but the integration of design focussed activities with programming provides a more balanced approach to working in digital media.

the Scratch image editor

Figure 3 - the Scratch image editor

Scratch also includes a number of built-in programming libraries which extend the capabilities of the language. These include music composition and drawing, controlling LEGO robotics products, Google Translate and text-to-speech.

High ceilings

As Scratch implements the fundamental programming constructs of sequence, selection and repetition it can be used to solve any problem that has a computable solution, and thus there is (almost) no limit to what an imaginative and determined programmer can achieve in Scratch. Whilst some will eventually find the slowness of block based programming or Scratch’s limited graphical canvas (the Scratch stage is limited to 480 pixels across by 360 high) frustrating and move on to traditional, text-based programming, many young programmers choose to continue with Scratch beyond the basics of learning to program, using it as a flexible tool for their own creative expression.

The most distinctive feature of Scratch is its vibrant and supportive global community. Scratch programs can be easily shared with a global audience: when they are, those viewing them can provide feedback to their creators, but they can also see how the programs have been made, and ‘remix’ their own modified or extended versions of these. Some Scratch users take on roles within Scratch’s community, curating online studios of example programs, creating guided walkthroughs for how to achieve particular effects in Scratch, or collaborating to develop the community’s own guidelines for how to behave online - the ‘high ceiling’ of Scratch can be seen in terms of participation within the community rather than just as more sophisticated coding or design.

Participation

Scratch started life as a tool designed with extracurricular or informal learning in mind (Maloney et al, 2008) rather than to support schools in teaching computer science or digital media. Scratch can be used freely online without any need for accounts to be created, and projects developed using the online editor can be downloaded for safe keeping. Scratch also has an offline editor, allowing programs to be developed without an internet connection. Furthermore, pupils are able to view all the projects shared to the online community, see how these have been made and make their own versions of these.

However, right from its foundation, Scratch has had a vibrant, online community of young programmers, and participation in this adds much to the opportunities that Scratch presents (Kafai and Burke, 2013). Primary aged pupils need parental permission to sign up for accounts in the Scratch community, although it’s now possible for teachers to create accounts for pupils in their class, assuming that the necessary consent has been obtained from parents or guardians.

Once a pupil has an account for the Scratch community site, they can start building a portfolio of their projects online, allowing them to start work in school and continue it at home, or to bring work from home into school to share with their teacher or classmates. Projects that pupils save to their portfolios can, optionally, be published to the world, for others to view, comment on, review the code and remix for themselves as a new version.

It is typically through this participation in the online community that young people really develop their fluency in Scratch programming, as well as ‘softer’ skills such as providing constructive feedback on others’ work, understanding what constitutes acceptable and unacceptable behaviour in an online community, and being able to work collaboratively with others. Whilst these things can be learnt, and should be taught, in school, participation in a worldwide community provides an appreciation for points of view very different from a pupil’s own.

There is much evidence (e.g. Lister et al, 2004) that new programmers need to read and understand code written by others as well as, and perhaps before, writing their own programs. Reading through and predicting the output from lots of example programs is unlikely to be found particularly exciting or motivating for primary pupils, or to afford much opportunity for creative work. An alternative approach would be to encourage participation in Scratch’s online community, giving pupils the time to explore projects written by others, using these as a starting point for their own tinkering or experimentation as they modify the project to make it their own, and through this interact with the code and design elements of their peers’ projects.

Through giving feedback on others’ projects, pupils can also develop their appreciation of others’ creativity, and might gradually grow into supporting other young programmers, through providing advice or collaborating on projects.

Participation in this community exposes pupils to online risks that might otherwise be avoided, but the Scratch community is a relatively safe space: it is uncommercial; no personal information needs to be shared; commenting by others can be turned off on a per-user or per-project basis, the community has a clear and ethical set of guidelines and policies on acceptable behaviour; there are reporting mechanisms for any concerns; and some moderation is in place.

Reflection

Have you used Scratch? Have you seen it being used in school? Have a look at the programs shared on the Scratch community site: what impression do you form? What challenges do you think primary pupils might encounter when programming using this environment?

References

Kafai, Y. B. & Burke, Q. 2013, ‘The social turn in K-12 programming: moving from computational thinking to computational participation’, Proceeding of the 44th ACM technical symposium on computer science education, 603–608

Lister, R., Adams, E. S., Fitzgerald, S., Fone, W., Hamer, J., Lindholm, M., McCartney, R., Moström, J. E., Sanders, K., Seppälä, O., & others 2004, ‘A multi-national study of reading and tracing skills in novice programmers’, ACM SIGCSE Bulletin, 36, 4, 119–150.

Maloney, J. H., Peppler, K., Kafai, Y., Resnick, M., & Rusk, N. 2008, ‘Programming by choice: urban youth learning programming with Scratch’, Proceedings of the 39th SIGCSE technical symposium on Computer science education, 367–371.

Resnick, M., 2017. Lifelong kindergarten: Cultivating creativity through projects, passion, peers, and play. Cambridge, MA: MIT press.