Lecture 14 Research topics in UI Software Natural





















- Slides: 21
Lecture 14: Research topics in UI Software: Natural Programming Brad Myers 05 -630 / 05 -430 Spring, 2004 1
The User Interface of Programming Languages n n n Programming is a human activity Want to improve the ability of people to program It makes sense to look at the human side 2
Who are the Authors? • Not just professional programmers – Many languages aimed at “part-time” or novice programmers • End User Programming! 3
Why EUP? n By 2005, 55 million end-user programmers n n n Compared to only 2. 75 million professional programmers Use spreadsheets, CAD systems, special-purpose scripting and visual languages, etc. These languages are unnecessarily hard to use and prone to errors n Errors in spreadsheets and other end-usercreated software costs companies millions of dollars 4
Design of New Languages n How make design decisions? n n Designer’s intuition Similarity to other languages n n But many have known problems Key concept: n If you care about usability and learnability: Can leverage off of what is known and what can be learned about people to guide design decisions 5
Why Study This? n There are many known problems n n n Little knowledge to guide designs The language which is currently popular seems to have about a 7 to 12 year window n n n Fortran, PL/1, Pascal, C, C++, Java, (maybe C# ? ) … So new languages are always being created We may influence design by identifying problems n n Programming is still hard to learn and hard to do Java / C# took some into account We certainly won't if we don't try, or if we don't know what to say! 6
Gentle Slope Systems Programming in C++ Visual Basic Lab. View MFC C Programming Difficulty of Use ast c e g Sta or t Crea C Programming Basic Goal Program Complexity and Sophistication 7
Natural Programming Research n n Try to provide a more scientific basis for programming language design Apply results of Empirical Studies of Programmers and Human-Computer Interaction to programming language design New studies to fill in gaps Design new programming languages and environments based on these results HCIC 8
Why Would Being Natural be Good? n Language should be close to user’s plan n n “Programming is the process of transforming a mental plan into one that is compatible with the computer. ” — Jean-Michel Hoc Example: n Inserting item into 3 rd place of high score list n n Easy by Direct Manipulation (in a spreadsheet) Difficult to program: n Loop, starting at end of array, shuffle items down, then insert HCIC 9
Background Research n Empirical Studies of Programmers and HCI results not being used in the design of new languages n n n 30 years of research on what makes languages hard to learn and error-prone Java / C# looping, etc. Summarized in our comprehensive tech report n John Pane and Brad Myers, “Usability Issues in the Design of Novice Programming Systems” TR# CMU-CS 96 -132. Aug, 1996. http: //www. cs. cmu. edu/~pane/cmu-cs-96 -132. html HCIC 10
Our Research n n Lots of gaps in prior research on people and programming Develop knowledge that can be used in design 11
Natural Programming Studies n How people naturally express programming concepts and algorithms n n n 1) Nine scenes from Pac. Man 2) Transforming and calculating data in a spreadsheet Specific issues of language design n 3) Selecting specific objects from a group (“and”, “or”, “not”) HCIC 12
Experimental Design n Question should not bias the answer So use pictures instead of textual descriptions Concentrate on kids, non-programmers n n Subjects should not be “tainted” by programming knowledge But test that the results generalize to adults and programmers 13
Study 1 n Usually Pacman moves like this. n Now let's say we add a wall. n Pacman moves like this. n Not like this. Do this: Write a statement that summarizes how I (as the computer) should move Pacman in relation to the presence or absence of other things. HCIC 14
Second Study n n Whether similar results from other domains and with adults Developed 11 questions with scenarios using spreadsheets n n To test database access and operations More conventionally “computational” 15
Example Question, 2 nd Study Question 4 • Describe in detailed steps what the computer should do to categorize these people into 2 groups of ‘Gold’ and ‘Black’. First name 1 Sandra 2 Bill 3 Cindy 4 Tom 5 Bill 6 Whitney 7 Michael 8 Jay 9 David 10 Will No. Last name Bullock Clinton Crawford Cruise Gates Houston Jordan Leno Letterman Smith Group Gold Black Gold 16
Results n Rule-based style “If Pac. Man loses all his lives, its game over. ” n n n Some use of Constraint style: “Pacman cannot go through a wall. ” Set operations instead of iterations “Subtract 20, 000 from all elements in Round 2” These tend to eliminate control structures HCIC 17
More Results n n Most arithmetic used natural language style “When Pac. Man eats a big dot, the score goes up 100. ” Operations suggest data as lists, not arrays n People don’t make space before inserting Objects normally moving “If Pac. Man hits a wall, he stops. ” n so objects remember their own state 2/3 of the first study subjects drew pictures n Usually to define the initial state HCIC 18
Implications for New Languages n n n Use event-based style for dynamic events Provide operations on groups of objects Work to minimize the need for control structures and variables Data structures that combine the capabilities of lists + arrays + sets Support simple arithmetic in natural language style (“add 1 to score”) Using mathematical notation such as > < rather than words achieves better accuracy 24
New Language and System: HANDS n Video 25
Donna on Eclipse, Andy on Marmalade 26