Explorations of Data Structures in a Programming System for Children
Thesis Supervisor: Professor Mitchel Resnick
Tamara Stern
6.UAP Masters of Engineering Thesis Proposal Department of Electrical Engineering and Computer Science Massachusetts Institute of Technology May 18, 2006
1
Abstract
Scratch is a media-rich programming language designed for children ages 10-16 by the Lifelong Kindergarten group of the MIT Media Lab. One of the goals of Scratch is for kids to understand basic programming concepts through their endeavors to create animated stories, video games, music videos, and other multimedia and interactive pieces. Currently, the concept of data structures is missing from Scratch. A handful of approaches have been tested in other programming environments designed for kids, but are often underused because data structure are presented in a very abstract way, with non- visible or manipulable representations. I propose to design a more concrete and understandable representation of data structures to be added to Scratch.
1. Introduction
Scratch is a media-rich programming language designed for children ages 10-16 by the Lifelong Kindergarten group of the MIT Media Lab [1]. Its primary purpose is to enhance the development of technological fluency at after-school centers in economically-disadvantaged communities. Scratch is meant to be a programming environment in which kids can create animated stories, video games, music videos, and other multimedia and interactive pieces. One of the goals of Scratch is for kids to understand basic programming concepts through their endeavors to create such projects.
Currently Scratch is missing a major core computer science concept: data structures. Without data structures, kids are limited in the scope of projects they can create and the computer science understanding that they will take away from Scratch. Although the area has been explored, there has not been an understandable and useful model that fits within the Scratch paradigm.
My project will be focused on researching past attempts, exploring different methods, and making suggestions for how to ultimately integrate simple data structures, such as lists and strings, into Scratch. Particularly I want to research how to incorporate visible and manipulable ways to represent these types of data. An example of a visible and tangible data structure implementation that I will explore is a table of high-scores for a game. I also want to explore how the user will interact with the data structures. Specifically, I will research the representation, primitives, and functions for the data structures. I will prototype and test my implementations at Computer Clubhouses (after-school centers for youth from low-income communities) in order to see which idea works best with children. The ultimate goal is to enhance Scratchs creative and educational worth through a richer functionality.
2. Background
The Lifelong Kindergarten group in the MIT Media Lab, led by Mitchel Resnick, specializes in designing new technologies that expand the range of what people can design, create, and learn. Specifically, the Lifelong Kindergarten group aims to introduce new technologies and activities in classrooms, museums, and after-school centers, nurturing and studying the growth of communities of playfully-inventive learners [2].
2
One of the efforts of the Lifelong Kindergarten group is a collection of after-school centers called Computer Clubhouses (see Figure 1). This effort, funded by Intel and run in conjunction with the Boston Museum of Science, is a worldwide endeavor to bring technology to underserved communities who would not otherwise have access to technological tools and activities [2]. The culture of computer clubhouse is one of self motivation, as kids choose to work on projects in which they have a personal interest.
Figure 1: Kids at a Computer Clubhouse.
2.1 Computer Clubhouse Cultures
Many informal cultures have developed in Computer Clubhouses. For example, a visual-design culture has emerged where children are creatively expressing themselves with professional graphic-design and image-processing software. Clubhouses have also developed a thriving music-production culture.
These cultures are very productive in the clubhouse, but they do not engage kids in programming as a form of self expression. The Lifelong Kindergarten group believes that it would be useful to encourage kids to express themselves, create projects they care about, and understand core computational ideas and concepts. In response to these beliefs, the group decided to build Scratch, with the goal of introducing a programming culture at Computer Clubhouses [3].
2.2 Scratch Programming Environment
Scratch is a programming environment, built on the Squeak programming language, that enables kids to create their own animations, videogames, interactive newsletters, music, simulations, and interactive art. Scratch builds on the tradition of other educational programming languages, such as Logo [4], but takes advantage of new computational ideas to make it easier to get started with programming and extend the range of what kids can create and learn [5]. Figure 2: Scratch layout Blocks Pallet Scripting Area Object Library Stage The basic layout of Scratch includes a stage where programmed objects interact, an object library, a scripting area for programs, and a blocks pallet which contains a list of programming blocks that can be used to build scripts (see Figure 2).
3
3. Goals
The goal of this project is to design a data-structure model for Scratch that is conceptually straightforward and easily used. The resulting model should exhibit these properties: Visible. The data should be visible to the user as opposed to hidden in memory. I will experiment with ways to have a concrete and clear representation of the data. Manipulable. I want kids to feel comfortable directly manipulating the data, by editing and touching it directly on the screen. Tinkerable. Kids should feel able to tinker with data structures and the commands for manipulating them by quickly and easily changing them and observing the outcome. Useful. The addition of data structures into Scratch should provide children with new opportunities for creative expression. Easily Learned. The model should be easily learned such that a user can figure it out on his or her own, as Scratch is meant to be used in informal settings outside of the classroom. Fits Within the Scratch Paradigm. The resulting model should make sense within the current Scratch feel and fit with other Scratch metaphors.
4. Previous Work
Currently, there are several other programming languages, similar to Scratch, that are designed specifically for kids. These programs have integrated data structures in various ways into their software. Although some other programs might have some other goals, and their models might not be fully applicable, there are lessons to be learned by looking at them. These examples will serve as informative examples to which I will refer when beginning my own development of data structures in Scratch.
4.1 Data Structures in Boxer
Boxer is a programming environment, designed in 1986, that is determined by two key principles the spatial metaphor and nave realism [7]. Pieces of data are grouped together in zoom-able boxes. Figure 3 shows how a phone book database would be implemented using Boxer. An overarching phone- book object contains a list which stores the entries of the phone book, a function-1-key function which changes the phone number of a person in the phone book, and two variables, number and name, which are provided to the user in order to add people to the phonebook. Figure 3: Data Structures in Boxer While this approach is very visual and tangible, the Boxer metaphor is quite different from the Scratch metaphor. However, this approach of zoom-able boxes in order to make all parts of a program completely tangible is 4
interesting, and will be considered during when deciding the proper way to integrate data management into Scratch.
4.2 Data Structures in MicroWorlds
MicroWorlds, released in 1993, is an educational software tool meant to teach programming concepts [6]. It is based on the Logo programming language which was pioneered by Dr. Seymour Papert [12]. In MicroWorlds, there are two representations of a collection.
Abstract Forms. Lists are represented in an abstract way, which can be instantiated and programmatically manipulated by calling procedures, including methods show, first, last, empty?, equal?, butfirst (returns all but the first element), butlast (returns all but the last element), and member?, in the command prompt area below the stage. Visual Forms. Strings are represented as words in a textbox which is viewable on the stage area, as illustrated in Figure 4. These textboxes may be manipulated by directly typing into them.
MicroWorlds uses a parse command to convert the contents of a textbox into an abstract list representation. For example, in order to extract a word from a textbox, MicroWorlds requires the following command: pick parse <name of object>. While this functionality is useful, the user is required to realize not only that the parse command exists, but also that it is used to change words in a string to elements in a list, which is necessary to extract a word from a sentence. Figure 4: Text boxes in MicroWorlds
Like the parse command, many of the interesting methods provided by MicroWorlds are underutilized because of their lack of visibility. Consequently, many users are unable to explore the possible functionalities of MicroWorlds without guidance.
While exploring ways to integrate data structures into Scratch, it will be essential to maintain the visible and tangible nature of Scratch. Specifically, integrated list structures would necessarily be presented on the screen and able to be directly manipulated, which differs from MicroWorlds abstract list representation. Additionally, I will attempt to minimize the amount of overhead necessary to perform simple tasks, such as picking a word from a sentence.
Other software has been created to help kids learn programming, such as StarLogo [8], LogoBlocks [9], and Etoys [10]. Through my research in the next few months, I will continue to explore previous attempts at integrating data structures into educational software applications.
5
5. Introducing Data Structures to Scratch
5.1 Data Structures in Scratch: Current Model
Currently, Scratch has one basic way to store data within the environment; specifically there are variables that can store numbers. This functionality allows kids to maintain different types of information in their Scratch projects. For example, a common use of Scratch is building interactive games. The variable feature allows children to maintain the score of the current user. Variables in Scratch may be created for all Sprites to use (global) or only for a particular sprite to use (instance specific). In order to create a variable, the user clicks on the Variables Tab of the Blocks Pallet. Here, they will see the option to create a new variable (for this sprite) or a new variable (for all). Next, the user is asked to assign the variable a name, as shown in Figure 5.
Figure 5: Creating a variablein Scratch
Once a variable is created, new blocks appear in the Blocks pallet that allow kids to programmatically change the variable by a certain amount, set the variable to an amount, or reference the variable somewhere in the Scripting Area. Figure 6 shows these blocks.
6
Figure 6: Variable blocks in the Blocks Pallet
Additionally, kids may drag and drop the variable reference (in this case, the score block) to the Stage in order to view and manually manipulate the contents, as shown in Figure 7. This feature allows the kids to actually see where information is maintained and have the control to change it however they choose.
Figure 7: Ways to manipulate a variable manually in the Scratch Stage area. The figure on the left displays the variable in an editable textbox, and the figure on the right shows a slider that the user can control to change the value of the variable.
5.2 Data Structures in Scratch: New Directions
Maintaining and manipulating variables in Scratch has allowed kids to explore different uses of Scratch, while also introducing them to the programming concept of maintaining state for a Sprite. However, variables are limited to only storing single numbers. Other types of data structures, such as collections or strings, would offer a new range of possible applications for kids using Scratch. For example, one could imagine Scratch projects that include a high score list, a batting average, or a phone number database (like the one presented in the Boxer example above). It is the groups hope that integrating data structures into Scratch will provide a richer environment to foster kids creativity.
7
For purposes of exploration, I will present two sample scenarios in which more involved data structures would be useful.
5.2.1 Creating Interactive Mad Libs Example 1
In this example, I explore the blocks that would be necessary in creating a Mad Libs game in Scratch. In particular, how a Scratch user could create random sentences from a collection of nouns and verbs.
In Figure 8, Nouns, Verbs, and Sentences are collections which would be displayed on the Stage Area. These collections would be created in the same way that a variable is created. Once created, these collections could be manipulated in a similar way to the way in which Microworlds collections are manipulated: either directly by the user (by typing into the text box) or programmatically by using the Scratch blocks in the scripting area. Each collection would have a set of corresponding blocks, including clear <collection>, add <string> to <collection>, and random item from <collection> as shown in the example.
The code shown below takes random words from Nouns and Verbs and places them in Sentence to create a random sentence.
Figure 8: Example of a Mad Libs implementation using data structures in Scratch.
5.2.2 Maintaining a High Score List Example 2
Scratch users often create games, for which a players score is maintained. In this example, I explore how a project would be created to maintain a list of high scores that are re-sorted each time a new score is added to the list. 8
In the example shown in Figure 9, both High Score and Player are collections, while score is a variable. All three of these objects will appear on the stage area of Scratch. After a game is completed, the score and Player are added to High Scores on a separate line. Then, the entire list of high scores is sorted by line, rather than by item. In other words, each line is treated as a unified entity, and only the first word or number is used to sort the entities. This type of line-by-line grouping lends itself to database-like interaction, where a line in the text box represents a record in a database.
The new blocks presented in this example are add endline to <collection>, add <item> to <collection>, <collection> (which can be treated as a string), and sort <collection> <numerically / alphabetically / randomly> by <line / word>.
Figure 9: Example of a high score list implementation using data structures in Scratch.
6. Research Approach
6.1 Immediate Goals
Currently I am collecting and reading the existing literature on Scratch and other educational software programs. In particular, the sources Ill begin with are: Mindstorms [11] by Seymour 9
Papert, Computers, Networks and Education [12] by Alan Kay and Some Reflections on Designing Construction Kits for Kids [13] by Mitchel Resnick and Brian Silverman.
Additionally, I will continue to research ways in which other educational programming languages integrate data structures into their systems. In particular, the programs Ill begin with are: StarLogo [8], LogoBlocks [9], and Etoys [10].
6.2 Risks
When adding features to Scratch, there is often the trade-off of a more powerful software versus a more understandable software. Often, the group has decided to make the software more understandable and therefore omitting complicated, although potentially useful, features. There is the possibility that adding data structures to Scratch might be considered too confusing for Scratch users. This discovery would still be important as the group might reconsider decisions made about Scratch. For example, objects in Scratch are currently made to be mostly independent from one another. This decision was made to reduce confusion that might arise with shared methods and variables. If this decision makes it difficult to integrate data structures in a useful and clear way, the Scratch team might reconsider object independence.
6.3 Feasibility
I spent the summer after my freshman year, in MITs Undergraduate Research Opportunities Program (UROP), working on the initial stages of development of Scratch. During that time, I was able to participate in many discussions on the functionality of Scratch. I was also able to add a variety of features to Scratch during my few months on the project. I am also familiar with the Clubhouse environment as I have visited a few times. Additionally, I have taken a variety of education courses at MIT, as well as spent time teaching children fulltime for a few months. I feel that with all of this experience, I will be able to do the necessary research around adding data structures in Scratch, implement prototypes, evaluate prototypes through user testing, and make recommendations for ultimate integration of data structures into Scratch during the next year and a half.
6.4 Timeline
2006 Spring - Read existing material on educational programming languages and creative use of data structures. - Explore other software applications and their integration of data structures. - Explore ways to integrate data structures into Scratch. - Complete 6.UAP writing requirement.
2006 Summer - Further explore ways to integrate data structures into Scratch. - Determine feasibility, effectiveness, and usability. - Re-familiarize self with programming language, Squeak.
2006 Fall - Prototype ideas for the chosen path. - Test the prototypes with children at Computer Clubhouses.
10
2007 Spring - Analyze results and decide which implementations are best suited for the Scratch programming environment and for the childrens needs. - Complete thesis writing requirement.
7. Conclusion
In summary, adding data structures that are conceptually understandable and useful to programming languages has proven difficult in the past. I propose to design a way to integrate data structures into Scratch in a way that is comprehensible and effective. Through researching past methods, prototyping, and user testing, I hope to design a system that is useful, clear, and educational with the ultimate goal to enhance Scratchs creative and educational worth through a richer functionality.
8. Acknowledgements
I would like to thank Mitchel Resnick and J ohn Maloney for their continued support and guidance through my years with the Lifelong Kindergarten group at the Media Lab.
9. References
[1] Maloney, J ., Burd, L., Kafai, Y., Rusk, N., Silverman, B., and Resnick, M. (2004). Scratch: A Sneak Preview, Second International Conference on Creating, Connecting, and Collaborating through Computing. Kyoto, J apan, pp. 104-109. [2] November (2005). http://llk.media.mit.edu/. [3] Resnick, M., Kafai, Y., Maeda, J ., et al. (2003). A Networked, Media-Rich Programming Environment to Enhance Technological Fluency at After-School Centers in Economically Disadvantaged Communities. Proposal to the National Science Foundation (funded 2003- 2007). http://www.media.mit.edu/~mres/papers/scratch.pdf. [4] November (2005). http://www.microworlds.com/. [5] November (2005). http://weblogs.media.mit.edu/llk/scratch/. [6] November (2005). http://el.media.mit.edu/logo-foundation/logo/. [7] diSessa, A., Abelson, H. (1986). Boxer: A Reconstructible Computational Medium. Communications of the ACM, vol. 29, no. 9, pp.859-868. [8] November (2005). http://education.mit.edu/starlogo/. [9] Begal, A. (1996). LogoBlocks: A Graphical Programming Language for Interacting with the World. Unpublished Advanced Undergraduate Project, MIT Media Lab. [10] Steinmetz, J . (2001). Computers and Squeak as Environments for Learning. In Rose, K. and Guzdial, M. (eds.), Squeak: Open Personal Computing and Multimedia. Prentice Hall: New York. [11] Resnick, M., Silverman, B. (2005). Some Reflections on Designing Construction Kits for Kids. http://web.media.mit.edu/~mres/papers/IDC-2005.pdf. [12] Papert, S. (1980). Mindstorms: Children, Computers, and Powerful Ideas. Basic Books. New York. [13] Kay, A. (1991). Computers, Networks, and Education. Scientific American, vol. 265, no. 3, pp. 100-107. 11