Once the components of the app have been specified in the Component Designer, the app’s behavior is defined in the Blocks Editor (see Figure 4). The Blocks Editor has two palettes. The first, My Blocks, contains functional blocks for interacting with the components that have been added to the particular app. The second palette contains built-in blocks for standard programming control and functionality including foreach, if-else, list and text manipulation, and logical operators. The blocks language provides a low-threshold entry to programming. The elimination of most typing dramatically reduces the frustrations beginners have with syntax, the blocks provide visual cues to ease the development task, and only some blocks lock into place, reducing the possibility of errors. The language also works because you define an app’s behavior directly as a set of event-handlers: when event X occurs, do Y (think of the complexities of programming the response to even a button click event in Java). For the app in Figure 4, the programmer has specified three event handlers: Texting.MessageReceived for processing an incoming text, LocationSensor.LocationChanged for tracking the driver’s current location, and SubmitResponseButton.click for recording a custom response entered by the user. Within weeks, students can learn enough eventresponse programming to create simple location-aware apps, SMS
processing apps, and games on the order of Mole Mash or Tic Tac Toe.