Natural Programming Languages and Environments
Natural Programming Languages and Environments
NATURAL PROGRAMMING
LANGUAGES AND By Brad A. Myers,
John F. Pane and Andy Ko
ENVIRONMENTS
Over the last six years, we have been working to create programming
languages and environments that are more natural, or closer to the way people
think about their tasks. Our goal is to make it possible for people to express
their ideas in the same way they think about them. To achieve this, we have
performed various studies about how people think about programming tasks,
both when trying to create a new program and when trying to find and fix
bugs in existing programs. We then use this knowledge to develop new tools
for programming and debugging. Our user studies have shown the resulting
systems provide significant benefits to users.
It is somewhat surprising that for looping, conditionals, and niques available for 60 years:
in spite of over 30 years of assignments shown to cause breakpoints, print statements,
research in the areas of empirical many errors for both beginning and showing the values of vari-
studies of programmers (ESP) and expert programmers in the ables.
and human-computer interac- C language. Systems such as Our thorough investigation of
tion (HCI), the designs of new MacroMedia’s Director and the ESP and HCI literature
programming languages and Flash, Microsoft’s Visual Basic, revealed many results that can be
debugging tools have generally and general-purpose program- used to guide the design of new
not taken advantage of what has ming environments like programming systems, many of
been discovered. For example, MetroWerks’ CodeWarrior and which have not be utilized in
the C#, JavaScript, and Java lan- Microsoft’s Visual C++, all pro- previous designs. However, there
guages use the same mechanisms vide the same debugging tech- are many significant gaps in our
Additional details about these studies are reported To examine the effective- Figure 2. The Alice
programming environment
in [9]. ness of HANDS, we con- with a “why didn’t”
ducted a user study. question in progress.
The HANDS Environment and Ten-year-olds were able to
Language learn the HANDS system during a three-hour ses-
The next step was to design and implement sion, and then use it to solve programming problems.
HANDS, a new programming language and envi- Children using the full-featured version of HANDS
ronment. The various components of this system performed significantly better than their peers who
were designed in response to the observations in our used a version modified to be more like typical pro-
studies as well as prior work. gramming systems. Additional details about this
HANDS uses an event-based language that fea- study are reported in [9].
tures a new model for computation, provides queries
and aggregate operators that match the way nonpro- Debugging Studies
grammers express problem solutions, has high visibil- Our studies of the language and structure that peo-
ity of program data, and includes domain-specific ple use helped us to design a more natural program-
features for the creation of interactive animations and ming language. We are also performing studies of
simulations. how programming environments can help program-
In HANDS, the computation is represented as an mers avoid making errors, and help them find and fix
agent named Handy, sitting at a table manipulating a the errors they have already made. An important part
set of cards (see Figure 1). All the data in the system of these studies is determining what causes program-
is stored on these cards, which are global, persistent, mers to make errors in the first place.
and visible on the table. We have integrated many strands of prior research
HANDS is event-based—a programming style on human error, and have found that errors are ulti-
that most closely matches the problem solutions in mately caused by long chains of breakdowns that hap-
our studies. It has full support for aggregate opera- pen for one of two reasons: some breakdowns occur in
tions—all operators can accept lists or singletons as the programmer’s head, such as using an inappropriate