Introduction to Scratch

A general introduction to MIT Media Lab’s Scratch for beginning programmers.

To the beginning programmer, most programming languages look like gibberish. Consider, for example, the following program, written in a programming language called Java.

class SayHello {
	public static void main (String[] args) {
		System.out.println(Hello world!);
	}
}

As you may have guessed (from ignoring all but two words of the code), all this program does, when executed, is display “Hello world!” But what’s the purpose of the curly braces ({ and })? What does System.out do? What does class or public static void main (String[] args) mean?

confused

Learning how to program does not mean trudging up such a steep learning curve as with a language like Java. Like speaking a foreign language, you must first learn to read and write in the new language even if the task at hand is relatively simple (such as saying “Hello world!”).

Learning to program is ultimately about learning to think and approach problems logically. The building blocks for any and all computer programs are relatively simple. Common building blocks are, for example, “variables” (whereby a program remembers certain values), “loops” (whereby a program does something multiple times), and “conditions” (whereby a program does something under specific circumstances).

For many students, the cryptic syntax of languages like Java gets in the ways of solving simple problems. Thus, before we tackle a language like Java with its seemingly complex curly braces and semicolon, let’s turn our attention to Scratch, a “new programming language that lets you create your own animations, games, and interactive art.” Scratch opens up an exciting world of computer programming where budding computer scientists can focus on problems and master programmatic constructs rather than syntax.

To use Scratch, you’ll need:

  • A computer with a recent Web browser (Chrome 7 or later, Firefox 4 or later, or Internet Explorer 7 or later) with Adobe Flash Player version 10.2 or later installed
  • A screen display that’s 1024 × 768 or larger
  • A reliable Internet connection
  • Optional: a microphone and speakers (or headphones) to record and listen to music

What is Scratch?

Scratch is a graphical programming language. This means that by simply dragging and dropping blocks of code, you can create programs. You can also share your creations with the online Scratch community. Scratch is designed for play, self-directed learning, and design.

Scratch GUI

Where did the name “Scratch” come from?

The technique of “scratching” describes the way hip-hop DJs creatively combine music. In the same way, Scratch programmers join different media (photos, sound effects, and music) to create something completely new.

Why is it so easy to use Scratch?

Scratch was designed to prevent common beginner pitfalls in traditional programming languages (as previously mentioned). Instead of typing code, programming in Scratch is made simple by dragging and dropping blocks of code.

This graphical interface allows users of any age or experience to easily control the way different commands react with each other. The jigsaw edges allow each block to fit with another only if it make computational sense. Colorized categories help students group different commands by related function. Also, since programs in Scratch run in real time, they can be edited and tested at any moment. All in all, Scratch allows students to easily experiment with new ideas.

Why learn to code?

Course Resources & References:


© 2020. Some rights reserved.