Scratch Constructs Revisited

Scratch Code Blocks

Recall that Scratch organizes types of blocks according to their usage. Each category is given its own pane and block color. For example, those blocks that affect the flow of program execution (such as branching paths and sequences of events) are a gold color, as seen to the right. If you know the type of tool you require, you can easily find it through the Scratch interface. Unfortunately, text-based languages like Processing are more difficult to navigate. In order to locate the proper tool for a job, you must first learn the basic constructs available to you.

The Mechanic vs. The Surgeon

In order to illustrate this idea, imagine two people, Anna and Beatrice, who are both professionals who use tools to “fix” broken machines. Anna is an auto mechanic. She uses a variety of tools such as wrenches, screwdrivers, and probes to diagnose and correct malfunctioning engine parts. Beatrice is a surgeon. She uses stethoscopes, scalpels, and forceps to diagnose and repair tissues and organs.

Anna has her tools organized in such a way that they are easy to find, easy to reuse, and easy to select. She has a toolbox with drawers specified for each type of tool: fasteners, diagnostics, electrical, etc. This is similar to the way Scratch organizes its available blocks. On the upside, blocks are easy to locate and select. On the downside, all of the available tools must be easily placed in a drawer according to its purpose.

Beatrice, the surgeon, has an assistant who locates tools and hands them to her upon request. The request, “Scalpel, blade #11,” is met with the correct tool. On the upside, the number of tools, variations in capabilities, and customization are more extensive than what Anna may be used to. On the downside, Beatrice must know exactly which tool she needs before she requests it. There is also much more potential for error: using the wrong tool for the job, making an incorrect request, etc.

As a programmer, it is important to have knowledge of the basic tools when using a text-based language such as Processing. It is much more difficult to “jump in” and start trying to construct a program than it is with Scratch, where all of the tools are laid out before you in an easily comprehensible manner.

As such, and this is very important, you should spend time familiarizing yourself with the basic commands available in Processing. One approach that may help you is to use the Scratch interface to explore types of commands and then seek out their equivalents in Processing. Additionally, reading other, pre-written programs and deconstructing how they work is one of the most useful approaches you can take to be successful. In fact, this approach will carry you through any number of languages and any level of expertise.