Scratch (Language)

Scratch mascot (top) and logo (bottom). Source: Gaadkii 2021.
Scratch mascot (top) and logo (bottom). Source: Gaadkii 2021.

Scratch is a visual block-based programming language designed for children aged 8-16. Children can create games, animations and stories in a fun-filled manner while also learning to reason and think creatively. Scratch is also an online community where creators can share their projects and be inspired by other projects.

Scratch is available in more than 150 countries in more than 60 languages. It's usage is license free. Scratch itself is open sourced. It's developed and overseen by the Scratch Foundation.

Scratch has been called "the YouTube of interactive media." Scratch has inspired other visual programming languages such as ScratchJr for ages 5-7, Snap!, mBlock, Stencyl and MIT App Inventor.

Discussion

  • Given dozens of programming languages, why do I need Scratch?
    An introduction to Scratch. Source: Scratch Ed 2011.

    Many popular programming languages are text-based. Programmers have to type the program code. They need to learn and remember the language syntax. For beginners, making syntax errors is a common problem. A text-based interface is less accessible and less fun for children.

    On the contrary, Scratch is designed for children aged 8-16. It can be taught at schools for students across all disciplines, including math, computer science, language arts, and social studies. This is important for today's economy where learning to code is part of computer literacy.

    Because Scratch is visual, it's less intimating than text-based programming languages. Programs in Scratch are created by drag-and-drop actions on colourful blocks. The use of shapes and colours act as visual cues to help programmers create, edit or understand Scratch programs more easily. In fact, shapes fit together like a jigsaw puzzle. It's designers claim that,

    Scratch is more tinkerable, more meaningful, and more social than other programming environments.

    Research has shown that Scratch enables students grasp computational thinking concepts such as parallelism, synchronization, flow control, user interactivity, data representation, abstraction and problem decomposition.

  • What types of projects can I create with Scratch?

    The main or popular project types in Scratch are:

    • Games: Games are the most common type, giving their creators large fan following. Even classics such as Pacman and Mario have been recreated in Scratch.
    • Animations: Using costume changes and movements, animations can be easily created.
    • Music: MIDI sound bank allows programmers to play up to 128 instruments. Volume and tempo can be adjusted. It's also possible to import a song and play it.
    • Art: Interactive art is one of the purposes for which Scratch was designed. More recently, non-interactive art is becoming common though less programming may be involved in creating them.
    • Stories: Not very common since many can be considered as animations. Stories could be adventures or feature many costumes and backdrops.
    • Simulations: Not that common but high quality projects involving physics, weather, gravity and 3D simulations have been created. Operating systems and engines are two common themes.

    Other types include tutorials, advertisements, sprite packs, slideshows, petitions, 100% pen, interviews, etc.

  • What are some essential Scratch programming terms?
    A sample script using different types of blocks. Source: Adapted from Scratch Wiki 2021f.
    A sample script using different types of blocks. Source: Adapted from Scratch Wiki 2021f.

    From a complete glossary for Scratch, we highlight a few essential terms:

    • Stage: Area where the project is displayed when active.
    • Backdrop: Background of the stage.
    • Block: Programming command that can be dragged and dropped into the code area.
    • Code Area: Area where scripts are edited.
    • Script: A stack of blocks make up a script. Determines how a sprite interacts with other sprites and the backdrop.
    • Sprite: Character or object on the stage that performs actions controlled by one or more scripts.
    • Clone: A copy of a sprite.
    • Costume: Appearance of a sprite. Often subtle variations of a sprite can be used to create animations.
    • Bubble: A speech bubble or a thought bubble signifies what a sprite is speaking or thinking.
    • Scrolling: Action of sliding a sprite across the stage.
    • Broadcast: A message sent through the Scratch program. Allows sprites to communicate with one another.
    • Event: Key press or mouse button clicks are example events. Can be used to trigger scripts.
    • Studio: A place to group and organize multiple projects.
    • Pen: Allows us to draw on the stage.
  • What's the anatomy of the Scratch IDE?
    The anatomy of the Scratch IDE. Source: Sweigart 2021.
    The anatomy of the Scratch IDE. Source: Sweigart 2021.

    The main areas of the IDE include the Stage, the Block Palette and the Code Area. The Stage is where the currently selected sprite appears. When the program runs, the results are displayed in the Stage. Stage can be maximized to full screen.

    Just below the Stage is the list of sprites that one can choose. When a sprite is selected, the scripts associated with it appear in the Code Area. These scripts can be created or edited by drag-and-drop actions of blocks from the Block Palette.

    The Costumes tab allow programmers to change the look of a sprite and thereby create visual effects and animations. The Sounds tab enables attaching sounds and music to the sprite.

  • Which are the different shapes and categories of blocks in Scratch?
    Shapes and categories of Scratch blocks. Source: Adapted from hello.mrs.green 2020 and Wikipedia 2021.
    Shapes and categories of Scratch blocks. Source: Adapted from hello.mrs.green 2020 and Wikipedia 2021.

    Blocks come in different shapes and categories. Each category comes in a different colour.

    Block shape represents a certain context of usage. For example, Hat Blocks occur at the start of a script whereas Cap Blocks occur at the end of a script. Their unique shapes mean that they can't be mistakenly used elsewhere within the script. Stack Blocks perform the main actions. Boolean Blocks return true or false. Reporter Blocks report fixed numbers, strings or variables. C Blocks (also called Wrap Blocks) wrap other blocks and are of Control category. Some C Blocks are capped at the bottom.

    Block category represents a certain type of functionality. Categories include Motion Blocks, Looks Blocks, Sound Blocks, Events Blocks, Control Blocks, Sensing Blocks, Operators Blocks, Variables Blocks, My Blocks, and Extensions.

    With My Blocks, programmers can define a custom script and call it with inputs from other scripts. Use of My Blocks reduces overall project size.

  • How do I get started with programming in Scratch?

    Create an account on Scratch website and start creating projects online. Perhaps the easiest way to work with Scratch is to create and edit projects via a web browser. No installation is required.

    Those who wish to work offline (without Internet connection), can download Scratch. Installations are available for Windows, macOS, ChromeOS and Android (tablets only). Scratch projects created from these installed apps can't be directly shared with the online community. You can however export a project, and then upload and share online.

    Official documentation is on the Scratch Wiki.

    You can explore Scratch projects shared by others. Participate in the Scratch discussion forum. The Scratch Ed channel on YouTube has many videos of tutorials, examples, events and workshops.

    Two useful books for beginners are Scratch 3 Programming Playground by Al Sweigart and Scratch Programming in Easy Steps by Sean McManus. The latter book doesn't cover Scratch 3.0 but its examples are available online.

    Advanced programmers who wish to contribute to Scratch's open source codebase can find the code on GitHub.

Milestones

1970

The idea of using programming as a skill and a learning tool probably begins with Seymour Papert in the 1970s. He creates the LOGO programming language. Language commands control movements of a digital robot. This helps children grasp geometry. A pen is used to draw shapes on the screen. LOGO and its turtle graphics are subsequently widely adopted in UK schools.

2003
Scratch 0.1 comes out in 2003. Source: Scratch Wiki 2021i.
Scratch 0.1 comes out in 2003. Source: Scratch Wiki 2021i.

Mitch Resnick and John Maeda of MIT, and Yasmin Kafai of UCLA propose the idea of Scratch to National Science Foundation (NSF). Resnick is part of Lifelong Kindergarten Group of MIT Media Labs. With an NSF grant, they create Scratch 0.1 by October. This version doesn't have a Block Palette and blocks are more square shaped.

Jan
2004

First Scratch website goes live. Elsewhere, it's reported that Scratch website was publicly launched in May 2007.

Jan
2007
Scratch 1.0 comes out in January 2007. Source: Scratch Wiki 2014.
Scratch 1.0 comes out in January 2007. Source: Scratch Wiki 2014.

Scratch 1.0 is released. It's also the first version released to public. The Scratch layout in this version resembles closely with a version from January 2005. Thus, we may state that the application has reached good level of maturity.

Jul
2009

Scratch 1.4 is released. Earlier versions include v1.1 (May 2007), v1.2 (Dec 2007), and v1.3 (Sep 2008).

May
2013
A screenshot of Scratch 2.0 offline editor. Source: Scratch Wiki 2019.
A screenshot of Scratch 2.0 offline editor. Source: Scratch Wiki 2019.

Scratch 2.0 is released. It gets a new user interface. Among its new features are procedures, cloning, cloud data, vector graphics, show/hide lists, and sound editor. The offline editor of this version continues to be available even in April 2021.

2015
Rendering in Scratch 2.0 (left) versus Scratch 3.0 (right). Source: Pasternak 2019.
Rendering in Scratch 2.0 (left) versus Scratch 3.0 (right). Source: Pasternak 2019.

Since Scratch 2.0 was based on Flash, and Flash is no longer preferred on the web, Google proposes a partnership with MIT Media Lab to redesign Scratch. By 2015, many other visual programming languages (Code.org, App Inventor, MakeCode) are already using a JavaScript library called Blockly. Scratch adopts Blockly. The redesigned UI and blocks are released as part of Scratch 3.0 (Jan 2019).

Jan
2019
Blocks added or replaced in Scratch 3.0. Source: NitroCipher 2018.
Blocks added or replaced in Scratch 3.0. Source: NitroCipher 2018.

Scratch 3.0 is released. Scratch 2.0 projects are compatible with the new version. Usability of the app is improved. Pen Blocks and Music Blocks are moved to Extensions. Stage is on the right, unlike Scratch 2.0 that had it on the left.

Apr
2021

Scratch community has close to 75 million shared projects, 70 million registered users, 448 million comments, and 29 million studios. In March, the site received 613 million pageviews and 29 million unique visitors. In TIOBE Index, Scratch ranks at position 22 in terms of popular programming languages. In April 2020, it was within the top 20.

References

  1. Chumpia, Erika. 2018. "Glossary for New Scratchers." Blog, Coding Kids, April 2. Accessed 2021-04-09.
  2. Collins, Keith. 2016. "How Adobe Flash, once the face of the web, fell to the brink of obscurity—and why it’s worth saving." Quartz, December 29. Accessed 2021-04-09.
  3. Gaadkii. 2021. "Scratch Logo." Cleanpng. Accessed 2021-04-10.
  4. McManus, Sean. 2020. "2nd Edn Scratch Programming in Easy Steps (Official)." Scratch, MIT, January 9. Accessed 2021-04-09.
  5. NitroCipher. 2018. "Welcome to the Scratch 3.0 Technical Discussion." Forum, Discuss Scratch, February 11. Updated 2018-08-10. Accessed 2021-04-09.
  6. Park, Youngki and Youhyun Shin. 2019. "Comparing the Effectiveness of Scratch and App Inventor with Regard to Learning Computational Thinking Concepts." Electronics, MDPI, vol. 8, no. 11, 1269. Accessed 2021-04-09.
  7. Pasternak, Erik. 2019. "Scratch 3.0's new programming blocks, built on Blockly." Google Developers Blog, Google, January 17. Accessed 2021-04-09.
  8. Redware Research Limited. 2021. "History of Scratch." Redware Research Limited. Accessed 2021-04-09.
  9. Resnick, Mitchel, John Maloney, Andrés Monroy-Hernández, Natalie Rusk, Evelyn Eastmond, Karen Brennan, Amon Millner, Eric Rosenbaum, Jay Silver, Brian Silverman, and Yasmin Kafai. 2009. "Scratch: Programming for all." Comms of the ACM, vol. 52, no. 11, pp. 60-67. doi: 10.1145/1592761.1592779. Accessed 2021-04-09.
  10. Schlothauer, Sarah. 2020. "Scratch claws its way up into top 20 programming languages." JAXenter, April 6. Accessed 2021-04-10.
  11. Scratch. 2021a. "Homepage." Scratch, MIT. Accessed 2021-04-09.
  12. Scratch. 2021b. "About Scratch." Scratch, MIT. Accessed 2021-04-09.
  13. Scratch. 2021c. "Download the Scratch app." Scratch, MIT. Accessed 2021-04-09.
  14. Scratch. 2021d. "Scratch Statistics." Scratch, MIT. Accessed 2021-04-10.
  15. Scratch Ed. 2011. "Intro to Scratch." Scratch Ed, on YouTube, November 14. Accessed 2021-04-09.
  16. Scratch Wiki. 2014. "File:1.0.png." Wiki, Scratch, MIT, September 18. Accessed 2021-04-09.
  17. Scratch Wiki. 2019. "File:Scratch 2.0 Offline Editor.png." Wiki, Scratch, MIT, January 4. Accessed 2021-04-09.
  18. Scratch Wiki. 2020. "Scratch Terms Glossary." Wiki, Scratch, MIT, April 26. Accessed 2021-04-09.
  19. Scratch Wiki. 2021a. "Scratch Wiki Home." Wiki, Scratch, MIT, March 28. Accessed 2021-04-09.
  20. Scratch Wiki. 2021b. "Scratch Versions." Wiki, Scratch, MIT, March 31. Accessed 2021-04-09.
  21. Scratch Wiki. 2021c. "Development of Scratch 1.0." Wiki, Scratch, MIT, March 26. Accessed 2021-04-09.
  22. Scratch Wiki. 2021d. "Offline Editor (2.0)." Wiki, Scratch, MIT, March 10. Accessed 2021-04-09.
  23. Scratch Wiki. 2021e. "Project Types." Wiki, Scratch, MIT, April 5. Accessed 2021-04-09.
  24. Scratch Wiki. 2021f. "Script." Wiki, Scratch, MIT, March 21. Accessed 2021-04-09.
  25. Scratch Wiki. 2021g. "My Blocks." Wiki, Scratch, MIT, January 7. Accessed 2021-04-09.
  26. Scratch Wiki. 2021h. "Blocks." Wiki, Scratch, MIT, April 3. Accessed 2021-04-09.
  27. Scratch Wiki. 2021i. "File:Scratch 0.1.png." Wiki, Scratch, MIT, March 31. Accessed 2021-04-09.
  28. ScratchJr. 2020. "About ScratchJr." ScratchJr, July 9. Accessed 2021-04-09.
  29. Sweigart, Al. 2021. "Getting Started with Scratch." Chapter 1 in: Scratch 3 Programming Playground, No Starch Press. Accessed 2021-04-09.
  30. TIOBE. 2021. "TIOBE Index for April 2021." TIOBE. Accessed 2021-04-10.
  31. Thomas, Brian. 2016. "Basic Scratch Vocabulary." Accessed 2021-04-09.
  32. Wikipedia. 2021. "Scratch (programming language)." Wikipedia, April 7. Accessed 2021-04-09.
  33. hello.mrs.green. 2020. "Scratch Shape Block Functions." Instructables, April 29. Accessed 2021-04-09.

Further Reading

  1. Scratch Wiki. 2021a. "Scratch Wiki Home." Wiki, Scratch, MIT, March 28. Accessed 2021-04-09.
  2. Scratch Wiki. 2021h. "Blocks." Wiki, Scratch, MIT, April 3. Accessed 2021-04-09.
  3. Sweigart, Al. 2021. "Getting Started with Scratch." Chapter 1 in: Scratch 3 Programming Playground, No Starch Press. Accessed 2021-04-09.
  4. McManus, Sean. 2019. "Scratch Programming in Easy Steps (Official)." Scratch, MIT, November 6. Accessed 2021-04-09.
  5. Resnick, Mitchel, John Maloney, Andrés Monroy-Hernández, Natalie Rusk, Evelyn Eastmond, Karen Brennan, Amon Millner, Eric Rosenbaum, Jay Silver, Brian Silverman, and Yasmin Kafai. 2009. "Scratch: Programming for all." Comms of the ACM, vol. 52, no. 11, pp. 60-67. doi: 10.1145/1592761.1592779. Accessed 2021-04-09.
  6. Maloney, John, Mitchel Resnick, Natalie Rusk, Brian Silverman, and Evelyn Eastmond. 2010. "The Scratch Programming Language and Environment." ACM Transactions on Computing Education, vol. 10, no. 4, article no. 16. doi: 10.1145/1868358.1868363. Accessed 2021-04-09.

Article Stats

Author-wise Stats for Article Edits

Author
No. of Edits
No. of Chats
DevCoins
2
0
2319
1
1
28
1639
Words
35
Likes
16K
Hits

Cite As

Devopedia. 2022. "Scratch (Language)." Version 3, February 15. Accessed 2024-06-25. https://devopedia.org/scratch-language
Contributed by
2 authors


Last updated on
2022-02-15 11:56:24