Tomas Petricek
email: t.petricek@kent.ac.uk
twitter: @tomaspetricek
office: S129A
What programmers work with
How programmers interact
What language syntax is easy to understand?
What programming abstractions fit mental models?
What tools can help making sense of code?
What real programmers actually struggle with?
Syntax: APL and Visual Basic .NET
User experience
What is easier to write or read?
What matters more in practice?
Does this matter for expert users?
Integrated Development Environments
Offer relevant help in context
How to assist with writing, debugging, navigating
Classic software engineering
Live coding, data science
REPL - Read, Eval, Print Loop
Type line, run it, see result
Immediate feedback, but limited interaction
Jupyter Notebooks
REPL with chart output
Can edit previous notebook cells
What is the mental model of execution?
Excel
Why finance and insurance companies (over)use it
so much?
Other forms of interactions
Programming by example
Compare syntax using controlled studies
Heuristic evaluation (consistency, system status)
How are systems used in corporate environment?
GOMS models of data analysis tasks
Metaphors for understanding code abstractions
Language syntax
Programming as writing
An empirical investigation into program-ming lang-uage syntax
Which of them is easier to use?
Controlled lab study, using 6 simple tasks
Statistically significant, scientific results
Used as a basis for Quorum language design
Random language is better than Perl!
Limited scope - syntax might be detail
Novices only - hard to evaluate with experts
Variable is like a label
A variable is like a label that one can place on one value, like a temperature or the age of a person
Variable is like a box
A variable is like a box that can contain a value, like a piggy bank or a shoe box.
Taught ~200 using label and ~200 using box
Student using box metaphor did better
Box leads to multiple values misconception
Metaphor used for learning programming
Learning how to program is hard
Designing a teaching language
LOGO and Turtle graphics
Turtle moves around screen with a pen
Learning by doing
Stages of cognitive development
Scratch
Learning by doing tradition
Supports multiple cognitive stages
How novices think about programming?
Conceiving vs. formalising solution
Write natural language solution
Design language to support the patterns
"Programming" a Pacman
Write a statement that summarizes how computer should move Pacman
Twelve 10 year olds
Responses categorized
by 5 CS students
Programming style
54% - rules or event-based
When Pacman eats all dots, he goes to the next level
18% - global constraints Cannot go through a wall
16% - declarations/other
There are 4 monsters.
12% - imperative
Display this string.
Play this sound.
HANDS System: Logic written using event-based rules!
Searching through code
Searching through possibilities
Code search
Study what developers search for
and why
Using data from logs and surveys
Analyze techniques and motivations for search
Finding very (17%) or somewhat (44%) familiar code
Learning how code works (46%) or how to use it (21%)
State space
Interaction questions
Programming interaction as search
Searching for a program in program space
Applying HCI methods in practice
Problems: Improving efficiency and understanding
Methods: Surveys, studies, metaphors, log analysis
Teaching programming to novices
What is the best metaphor for variables?
What is natural language of programming?
Human computer interaction as search
Searching for options in user interface
Searching the space of possible programs
What you should remember from this lecture
Tomas Petricek
t.petricek@kent.ac.uk | @tomaspetricek
Books
Papers and links
code search https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43835.pdf
pacman http://alumni.cs.ucr.edu/~ratana/PaneRatanamahatanaMyers00.pdf
hci http://www.pgbovine.net/what-is-hci-research.htm
felienne http://www.felienne.com/archives/6063
How do people naturally think about computation? Cyrus Omar https://www.cs.cmu.edu/~comar/NaturalComputation.pdf