Published: August
7, 2008
Revised: February 17, 2010
By Richard G. Baldwin
Homeschool Programming Notes # 10000
A prediction
It's probably safe to say that a large percentage of the professional athletes in the major leagues of sports are people who became involved in sports in little league when they were quite young. It's probably also safe to say that a large percentage of successful professional musicians were either enrolled in serious musical instruction at an early age, or were involved as members of garage bands by their early teens.
I predict that in ten to fifteen years, computer science professionals and professionals in a variety of computer-related fields will be the people who are currently engaged in the little leagues of computer science.
Where are the little leagues of computer science?
One of the most important little leagues of computer science at this time is centered in the Lifelong Kindergarten group at the MIT Media Lab (see Resources). This group has developed and is supporting something called Scratch. According to MIT,
"Scratch is a new programming language that makes it easy to create your own interactive stories, animations, games, music, and art -- and share your creations on the web.
Scratch is designed to help young people (ages 8 and up) develop 21st century learning skills. As they create Scratch projects, young people learn important mathematical and computational ideas, while also gaining a deeper understanding of the process of design."
Scratch is available free of charge and is currently available for Mac OSX and Windows.
Some statistics
According to an article recently published by MIT personnel (see Interactions in Resources)
"On the morning of May 14, 2007, the (Scratch Online Community) website was officially launched. Several news outlets and social news websites featured the Scratch website on their front pages. In a matter of hours the server and the website could not handle the traffic and the website went down several times."
According to statistics published on the Scratch home page (see Resources) on the afternoon of June 8, 2008,
"There are 144,516 projects with a total of 3,666,174 scripts and 1,061,626 sprites created by 25,047 contributors of our 116,608 registered members."
Note that these numbers are two to three times greater than they were in early December of 2007 and the numbers continue to increase on a minute by minute basis.
Archived projects are readily available
Also, as of the afternoon of June 8, 2008, all 144,516 of those projects (see New Scratch Projects in Resources) ranging back in time back to about March of 2007 (the beta release of the website was March 4, 2007) were archived and available for online execution and/or downloading and examination at the source code level. Thus, the amount of resource material available to budding Scratch programmers is almost limitless.
Post, review, and comment
MIT makes it possible for every scratcher (as the members of the Scratch community refer to themselves) to share his or her projects for online execution and/or downloading and examination by other scratchers. MIT also makes it possible for other scratchers to review and critique the projects shared by others. Registration is free and open to everyone. However, MIT seems to make a significant effort to hide the true identities of the registrants and also seems to make a significant effort to ensure that the posted material is age appropriate for middle school students.
An organized system for peer review and critique is provided. The system is too elaborate for me to try to describe it here. If you want to know more about that, simply register (become a scratcher) and take a look at it for yourself.
I estimate three completed Scratch projects per minute worldwide
Some of the shared projects are really exciting, and some were obviously created and published by beginners who are just getting their feet wet. Regardless, there are a huge number of players in this little league of computer science. As of 3:00 p.m. CDT on Sunday afternoon, June 8, 2008, approximately 370 budding programmers had created and shared Scratch projects during the previous eight hours. That represents an average time interval of about 1.3 minutes between shared projects over that eight-hour period (and it was only 1:00 p.m. on the west coast). It would be a full-time job just to execute and review every project that is shared.
I have no idea what percentage of completed Scratch projects actually get shared on the Scratch website. My guess would be that probably no more than twenty-five percent of completed projects are shared. If that guess is anywhere close to correct, that means that on average, about three Scratch projects per minute were completed on a world-wide basis during the previous eight-hour period. If each project requires four or five hours to complete, a lot of budding programmers were working on Scratch projects during and before that eight-hour period.
A world-wide phenomenon
This is not just a United States phenomenon. The scratchers are located in many different countries around the world. A forum is provided for scratchers to exchange information with one another. As of this writing, that forum is available in the following languages:
Also, many scratchers whose first language is not English participate in the English version of the forums and provide English-language descriptions of their projects when they publish them.
An article recently published by MIT personnel indicates that the Scratch community receives visitors from 213 different countries, mainly from the U.S., U.K., Canada, Australia, Japan, Germany, Brazil, Spain, France and India.
Demographics
The same article stated that based on the first five months of usage data,
"...users are primarily age 8 to 17, with a peak at age 12. A good number of users are adult computer hobbyists and educators that create projects in Scratch, even though a lot of them know other professional programming languages. Some members of the community have emerged as mentors that help the beginners and provide advice."
The article also stated,
"While 70 percent of users are male, no correlation was found between gender and the number of projects... This indicates that even though the majority of users are male, the females are as engaged in creating projects as the males."
Not in organized classes
By following the discussions in the forums, I have observed that a large percentage of scratchers are not enrolled in any sort of formal programming classes. Rather, this is something that they are doing on their own. In fact, it seems that for many scratchers, creating, sharing, and discussing projects is a form of social networking much like other students might engage in using the better known social networking sites.
I recommend that you open another copy of this document in a separate browser window and use the following links to easily find and view the figures while you are reading about them.
The scratchers who create and post these projects come at it from many different viewpoints, but they are all programming in order to accomplish their own purposes. My guess is that in many cases, programming is simply a means to an end. For example, I would categorize the scratcher named pandalecteur, whose work you will see in Figure 1, as a serious artist. You will find a link to more of her creations in Resources. She combines her programming talent with her artistic talent to produce beautiful animated creations.
Figure 1. Rushes with sun by pandalecteur.
Click here to view the applet. Close the page when finished viewing. |
The Scratch player applet
Scratch projects are normally executed within the Scratch development environment shown in Figure 6. However, you must have the Scratch software installed on your computer to execute and view the projects that way. The animations that you will see in this article are produced by a Java applet that was created by MIT to cause the scratcher's shared projects to be accessible online with no requirement for the viewer to have Scratch installed.
The applets start executing as soon as the web page that contains them is loaded into the browser. You can stop the execution of an applet by clicking the red button in the upper-right corner of the Java applet window. You can restart the execution of the applet by clicking the green flag.
Click the link to run the applet
Figure 1 contains a screen shot from the applet along with a link that you can click to open another page (window) and cause the applet to run in that page.
Be sure to close the pages
Be sure to close the pages containing the applets when you finish viewing them (or at least click the red button) to avoid having multiple applets running at the same time as you read the remainder of this article.
What if the applets don't run?
You may find that these applets won't run on your computer. If so, that probably means that the Java runtime environment is not installed on your computer. You can download and install the Java software using the link that is provided in Resources.
Anime projects
Figure 2 represents another category of Scratch projects commonly seen on the Scratch web site. Many of the scratchers create the characters for what amounts to animated comic strips often referred to as anime. Sometimes the characters are used to tell a story and sometimes the authors/artists are content to simply draw and display the characters. Sometimes I read about two scratchers getting together with one doing the art work and the other doing the animation programming.
Figure 2. Tsukihime Eye Blink by MahoAshley.
Click here to view the applet. Close the page when finished viewing. |
Figure 2 shows an animation involving an anime character blinking her eyes. (Large blinking eyes on female characters seem to be a popular theme in the world of anime.) If you have your speakers turned on, you should hear background music with this animation. I believe that the author also described the anime shown in Figure 2 as being a crocodile.
I described pandalecteur earlier as a serious artist. In the same vein, I would describe MahoAshley who created the project shown in Figure 2 as an anime artist. I'm not discrediting or indicating a preference for either artist. I am simply recognizing the different viewpoints of the two. You can find a link to more of MahoAshley's creations in Resources.
Game projects
As you may have guessed, many scratchers like to create games. Most of them are 2D games such as the Marble Racer game by jamie shown in Figure 3 where the object of the game is to use the arrow keys to cause the marble to roll all the way around the track without being slowed down by rolling onto the grass. You will find a link to more of jamie's creations in Resources.
Figure 3. Marble Racer SBE 4000 by jamie.
Click here to view the applet. Close the page when finished viewing. |
3D games
A few scratchers push the envelope and attempt to make 3D games, although the mathematics involved seems to be too advanced for most scratchers. My observation so far is that most of the 3D games that they make are so slow as to be extremely boring. Nonetheless, working on a 3D game in Scratch is a very educational process since Scratch doesn't provide any built-in support for doing 3D projections other than providing the necessary trigonometric functions.
A pseudo-3D animation
Figure 4 shows a pseudo-3D animation of my own design. In this project, the walking sprite follows the mouse pointer. Various tricks were employed to create an illusion of perspective in order to create an illusion of 3D. If the sprite doesn't walk fairly smoothly, make sure that you have stopped the execution of all of the other applets.
Figure 4. Perspective03 by dbal.
Click here to view the applet. Close the page when finished viewing. |
Pandora's box
Figure 5 shows an animated comic strip, once again by MahoAshley. In this project, the main character goes through several scenes before reaching the "to be continued" message at the end.
Figure 5. Pandora's box saga Ep 1 by MahoAshley.
Click here to view the applet. Close the page when finished viewing. |
The tip of the iceberg
These five examples are simply the tip of the iceberg in terms of the different purposes for which scratchers create projects. If you can imagine it in an animated computer program, some scratcher has probably already tried to do it.
Figure 6 shows a reduced screen shot of the Scratch development environment. The text in Figure 6 is too small to read in most cases. The main purpose is to provide information about the overall layout of the development environment.
Figure 6. Screen shot of the Scratch development environment.
Scratch programming tutorial lessons
Before getting into the technical details, let me mention that I have published a set of tutorial lessons on Scratch programming. You will find a link to those tutorial lessons in Resources.
A sprite-oriented programming environment
Scratch is a sprite-oriented programming environment. Every Scratch project consists of none, one, or more sprites and a stage upon which the sprites perform the behavior for which they are designed.
A sprite is an invisible entity to which the programmer can assign numerous behaviors. Each sprite can have one or more costumes. The assignment of a visible costume to an invisible sprite causes the sprite to also become visible.
Costumes
The Scratch development environment provides a large gallery of costumes and you can create your own costumes if you don't find any in the gallery that suit your needs. A costume is nothing more than an image. The background in the image is normally transparent. You can import images from a variety of different file types to create costumes. Probably the most difficult task in creating a costume from an imported image is causing the background to be transparent (if the image didn't originally have a transparent background). A built-in paint program is provided to assist in this task. You can also use programs such as the free GIMP image editor (see Resources) to deal with the background.
Walking-boy costumes
The project shown in Figure 4 uses five costumes from a family of seven costumes that are available in the gallery. Six of the seven costumes are shown in Figure 7. The project shown in Figure 4 uses only the five rightmost costumes shown in Figure 7.
Figure 7. Costumes for a boy walking.
As you can see, the five rightmost costumes describe five stages in a boy walking. The project shown in Figure 4 cycles through the five costumes in such a way as to make it appear that the boy is walking.
The stage
The stage is the large white rectangle in Figure 6. Different images can be assigned to the stage to serve as backgrounds for the performance of the sprites. The gallery contains a large number of background images, and you can also create your own. Usually for a background image, you don't have the transparency issue discussed earlier so backgrounds for the stage can be easier to create than costumes for sprites.
A moonscape background from the gallery was used for the project shown in Figure 4.
Controlling the behavior of a sprite
You control the behavior of a sprite by writing one or more scripts that belong to the sprite. In reality, each script is an event handler of sorts. Usually you will have one event handler that executes when the user clicks the green flag at the top right in Figure 6. This is particularly true if any special initialization code is required for the sprite, such as setting the current costume to a particular costume, for example.
In addition to the green-flag script, you can also write scripts to handle mouse events, key events, and a special type of event that fires when one sprite broadcasts a message to one or more other sprites. Therefore, Scratch projects are not only sprite-based; they are also event-based. These are relatively advanced concepts in most programming environments. However, Scratch was designed in such a way as to make it easy to write event-handler scripts to control the behavior of sprites.
Drag and drop programming
Creating Scratch programs involves very little typing. Instead, scripts are created by constructing stacks of blocks, where each block imparts some specific behavior to a sprite or to the stage. For example, the project being developed in Figure 6 has a stage, (which is always the case) but doesn't yet have any sprites. The stage is represented by the rectangular thumbnail image in the bottom right area of Figure 6. Any sprites that are added to the project would also show up as thumbnail images in that same area. I will refer to this area as the sprite list area.
The physical process for writing a script is as follows:
You can learn the details of such operations in Baldwin's Scratch programming tutorials (see Resources).
Costumes and sounds
Selection of the other two tabs showing at the top of the center pane in Figure 6 exposes the controls for importing, editing, and creating costumes and backgrounds, as well as recording and/or importing sound files to be used as music and sound effects.
Despite the fact that Scratch has amassed a huge following since its Beta release on March 4, 2007, the language isn't a particularly good language from a computer science viewpoint. Of the ten or fifteen programming concepts that most computer science professors consider to be fundamental to good programming, Scratch supports only a few:
Note in particular the absence of programmer-defined functions or methods in the above list.
However, what Scratch lacks in the support of fundamental programming concepts, it makes up for in high-level multimedia functionality. In effect, Scratch provides just enough in the way of fundamental programming capability to form a bridge to the multimedia functionality.
Music, music, music
Among other things, (particularly including the availability of a quasi social-networking community), it is probably this multimedia functionality that has attracted the large following among middle school and high school students.
|
Although I may be wrong, I strongly suspect that website participation would be dramatically reduced if MIT were to purge the website of all projects containing copyright music and disallow the future publication of new projects containing copyright music unless the scratcher owns the copyright.
There are a few projects on the website containing original music developed by the scratcher. I recall seeing one project where the scratcher was offering to compose original music to be used by other scratchers. However, that is the exception and not the rule. Most of the music on the website appears to be copyright music with a high probability that no permission for publication was obtained from the owner of the copyright.
The toolbox buttons and toolbox pane
Figure 8 shows a near normal size screen shot of the leftmost portion of Figure 6.
Figure 8. The toolbox buttons and toolbox pane.
The small frame at the top of Figure 8 show the eight toolbox buttons that you click to expose a corresponding toolbox of blocks in the lower frame. (The Variables toolbox was selected before capturing the screenshot shown in Figure 8.)
High-level multimedia functionality
With regard to high-level multimedia functionality, Scratch makes it possible and relatively easy for scratchers to do the things they like to do such as:
These capabilities, which are often difficult to access using "typical CS-approved" programming languages, provide a great deal of sensory feedback and they are a lot of fun to program. Even I must admit that I waste more time than I should playing with these capabilities and producing projects that have absolutely no practical value beyond the fact that they are entertaining and relaxing.
Program control
This high-level multimedia functionality is controlled by:
As a practical matter, the four buttons on the left in Figure 8 are the fun buttons and the four buttons on the right are the control buttons.
What conclusions should we as educators take away from this article? If nothing else, we should conclude that things are going to change. Assuming that this movement continues to grow among middle school and high school students, we can expect that copycat products will arise out of other institutions. Given the success of Scratch in amassing an extremely large following in a very short time period, it might also be expected that the new products will also be short on fundamental programming capability and long on easily-accessible high-level multimedia functionality.
Therefore, within a few years, we are likely to be faced with large numbers of students who know very little about programming fundamentals but who have learned to push the right buttons to create exciting multimedia effects using their favorite Scratch-like products. It will be up to us to help them understand that real-world programming involves much more than just pushing buttons in a Scratch-like programming environment. The challenge will be in bringing them to that realization without driving them away and having them join the ranks of computer science dropouts.
How do we accomplish that? Unfortunately, I don't have the answer. However, I do know that the answer is not to simply bury our heads in the sand and hope that the problem will go away, because it probably won't. The good news is that we will likely see a lot of students who are very computer-savvy in certain specialized areas. The bad news is that we are going to have to figure out how to help them to become computer savvy in the more traditional areas as well without driving them away.
Baldwin's Scratch
programming tutorials
Scratch Home Page
About Scratch
New Scratch Projects
Lifelong Kindergarten group at the
MIT Media Lab
Article in
Interactions
GIMP image editor
Download Java at
http://java.com/getjava/index.jsp
Rushes with sun by
pandalecteur
Tsukihime Eye Blink by
MahoAshley
Marble Racer SBE 4000 by jamie
Perspective03 by dbal
Pandora's box saga Ep1 by
MahoAshley
Copyright 2008, Richard G. Baldwin. Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.
Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas. He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.
In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP). His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments. (TI is still a world leader in DSP.) In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.
Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.
-end-