Announcements

advertisement
Announcements
•
•
•
•
Design Jam schedule
Project – Evaluation due Fri July 30th 11:59pm
Paper presentations
Paper/System presentations. Takers?
– Tue: Eisenberg et al.’s “Apatite: A New Interface for Exploring
APIs”
www.cs.cmu.edu/~NatProg/papers/p1331-eisenberg-apatiteCHI.pdf
– Tue: Daughtry et al.’s: “API usability: Report on Special Interest
Group at CHI”
http://john.daughtryhome.com/publications/DAUGHTRY_FAROOQ
_MYERS_STYLOS_SEN_2009.pdf
Supporting programmers:
Cognitive Dimensions
CS352 Summer 2010
Cognitive Dimensions
• Analytical technique to evaluates visual
programming languages (VPLs)
• VPLs
– let users create programs by manipulating
program elements graphically rather than by
specifying them textually
• Examples?
Alice
Simulink
Yahoo!Pipes
• http://pipes.yahoo.com/pipes/
Dimensions Outline
• Abstraction Gradient: What are the minimum and maximum
levels of abstraction? Can fragments be encapsulated?
• Closeness of mapping: What ‘programming games’ need to
be learned?
• Consistency: When some of the language has been learnt,
how much of the rest can be inferred?
• Diffuseness: How many symbols or graphic entities are
required to express a meaning?
• Error-proneness: Does the design of the notation induce
‘careless mistakes’?
Dimensions Outline
• Hard mental operations: Are there places where the user
needs to resort to fingers or pencilled annotation to keep
track of what’s happening?
• Hidden dependencies: Is every dependency overtly indicated
in both directions? Is the indication perceptual or only
symbolic?
• Premature commitment: Do programmers have to make
decisions before they have the information they need?
• Progressive evaluation: Can a partially-complete program be
executed to obtain feedback on “How am I doing”?
Dimensions Outline
• Role-expressiveness: Can the reader see how each
component of a program relates to the whole?
• Secondary notation: Can programmers use layout, colour, or
other cues to convey extra meaning, above and beyond the
‘official’ semantics of the language?
• Viscosity: How much effort is required to perform a single
change?
• Visibility: Is every part of the code simultaneously visible
(assuming a large enough display), or is it at least possible to
juxtapose any two parts side-by-side at will? If the code is
dispersed, is it at least possible to know in what order to read
it?
Dimensions Outline
Abstraction Gradient: What are the minimum and maximum
levels of abstraction? Can fragments be encapsulated?
• Closeness of mapping: What ‘programming games’ need to
be learned?
• Consistency: When some of the language has been learnt,
how much of the rest can be inferred?
• Diffuseness: How many symbols or graphic entities are
required to express a meaning?
• Error-proneness: Does the design of the notation induce
‘careless mistakes’?
Abstraction Gradient
•
•
•
•
•
•
Abstraction Gradient: What are the minimum and maximum levels of abstraction?
Can fragments be encapsulated?
An abstraction is
– a grouping of elements to be treated as one entity
Examples?
– Functions, classes, types, control abstraction like loops, conditionals, …
Abstraction-hating (e.g., flowcharts)
– Only contain decision boxes and action boxes; you can’t have other
abstractions
Abstraction-tolerant (e.g., C)
– Can be used exactly as they come, but also allowing new abstractions of
several kinds to be created
Abstraction-hungry (e.g., SmallTalk, C#)
– To start writing a program, you first modify the class hierarchy
– Every program requires a new abstraction
– The novice programmer cannot simply map problem entities onto domain
entities.
Abstraction Gradient (cont’d)
• Finding the right balance is not easy
• Downsides of abstractions:
– Hard for novices
– Delayed gratification
• Upsides:
– Right abstractions increase comprehensiveness of
a language
– Closer map to the problem
Dimensions Outline
• Abstraction Gradient: What are the minimum and maximum
levels of abstraction? Can fragments be encapsulated?
 Closeness of mapping: What ‘programming games’ need to
be learned?
• Consistency: When some of the language has been learnt,
how much of the rest can be inferred?
• Diffuseness: How many symbols or graphic entities are
required to express a meaning?
• Error-proneness: Does the design of the notation induce
‘careless mistakes’?
Closeness of mapping
• Mapping = mapping between a problem
world and a program world
• Close mapping is good
But how close?
• An example
– Java/C# (general purpose) vs. spreadsheet
(domain specific – maps directly to the problem)
Dimensions Outline
• Abstraction Gradient: What are the minimum and maximum
levels of abstraction? Can fragments be encapsulated?
• Closeness of mapping: What ‘programming games’ need to
be learned?
 Consistency: When some of the language has been learnt,
how much of the rest can be inferred?
• Diffuseness: How many symbols or graphic entities are
required to express a meaning?
• Error-proneness: Does the design of the notation induce
‘careless mistakes’?
Consistency
• Consistency = ?
• = when a person knows some of the language
structure, how much of the rest can be
successfully guessed?
Dimensions Outline
• Abstraction Gradient: What are the minimum and maximum
levels of abstraction? Can fragments be encapsulated?
• Closeness of mapping: What ‘programming games’ need to
be learned?
• Consistency: When some of the language has been learnt,
how much of the rest can be inferred?
 Diffuseness: How many symbols or graphic entities are
required to express a meaning?
• Error-proneness: Does the design of the notation induce
‘careless mistakes’?
Diffuseness/Terseness
• = How many symbols or graphic entities are
required to express a meaning?
• Esp. an issue w/ VPLs b’c of real estate
• Too diffuse:
– more material to be looked at  smaller the
proportion can be held in working memory  greater
the disruption
• Too terse:
– Different programs hardly differ visually  difficult to
look and tell
Dimensions Outline
• Abstraction Gradient: What are the minimum and maximum
levels of abstraction? Can fragments be encapsulated?
• Closeness of mapping: What ‘programming games’ need to
be learned?
• Consistency: When some of the language has been learnt,
how much of the rest can be inferred?
• Diffuseness: How many symbols or graphic entities are
required to express a meaning?
•  Error-proneness: Does the design of the notation induce
‘careless mistakes’?
Error-proneness
• = Does the design of the notation induce
‘careless mistakes’?
• Examples of preventing errors:
– Type systems
– Program won’t pass compiler if it uses
uninitialized variables
– Auto-complete instead of having to type every
word
–…
Dimensions Outline
 Hard mental operations: Are there places where the user
needs to resort to fingers or pencilled annotation to keep
track of what’s happening?
• Hidden dependencies: Is every dependency overtly indicated
in both directions? Is the indication perceptual or only
symbolic?
• Premature commitment: Do programmers have to make
decisions before they have the information they need?
• Progressive evaluation: Can a partially-complete program be
executed to obtain feedback on “How am I doing”?
Hard mental operation
•  Are there places where the user needs to resort to fingers or
pencilled annotation to keep track of what’s happening?
• Consider the following sentence:
Unless it is not the case that the lawn-mower is not in the shed,
or if it is the case that the oil is not in the tool-box and the key is
not on its hook, you will not need to cut the grass....
Hard mental operation (cont’d)
• A broad-brush test for hard mental operaion
is:
1. if I fit two or three of these constructs together,
does it get incomprehensible?
2. is there a way in some other language of making
it comprehensible? (Or is it just a really hard idea
to grasp?)
If the answer is Yes to both, then it counts.
Dimensions Outline
• Hard mental operations: Are there places where the user
needs to resort to fingers or pencilled annotation to keep
track of what’s happening?
 Hidden dependencies: Is every dependency overtly indicated
in both directions? Is the indication perceptual or only
symbolic?
• Premature commitment: Do programmers have to make
decisions before they have the information they need?
• Progressive evaluation: Can a partially-complete program be
executed to obtain feedback on “How am I doing”?
Hidden dependencies
Is every dependency overtly indicated in both
directions? Is the indication perceptual or only
symbolic?
• Dependency
– relationship between two or more things
• Bad examples:
– a function surreptitiously altered the value of a global
variable
– formula in a cell tells which other cells it takes its value
from, but does not tell which other cells take their value
from it
– GOTOs (absence of come-from)
Dimensions Outline
• Hard mental operations: Are there places where the user
needs to resort to fingers or pencilled annotation to keep
track of what’s happening?
• Hidden dependencies: Is every dependency overtly indicated
in both directions? Is the indication perceptual or only
symbolic?
 Premature commitment: Do programmers have to make
decisions before they have the information they need?
• Progressive evaluation: Can a partially-complete program be
executed to obtain feedback on “How am I doing”?
Premature commitment
Do programmers have to make decisions before
they have the information they need?
• An example:
– Forced to choose what features to have when first
installing a piece of software
• When does this problem arise?
1. the notation contains many internal dependencies
2. the medium or working environment constrains the
order of doing things, and
3. the order is inappropriate
Dimensions Outline
• Hard mental operations: Are there places where the user
needs to resort to fingers or pencilled annotation to keep
track of what’s happening?
• Hidden dependencies: Is every dependency overtly indicated
in both directions? Is the indication perceptual or only
symbolic?
• Premature commitment: Do programmers have to make
decisions before they have the information they need?
 Progressive evaluation: Can a partially-complete program be
executed to obtain feedback on “How am I doing”?
Progressive evaluation
Can a partially-complete program be executed
to obtain feedback on “How am I doing”?
• Novices need to evaluate their own problemsolving progress at frequent intervals
• Experts can usually live without it if they have
to, but even they prefer to have it
Dimensions Outline
 Role-expressiveness: Can the reader see how each
component of a program relates to the whole?
• Secondary notation: Can programmers use layout, colour, or
other cues to convey extra meaning, above and beyond the
‘official’ semantics of the language?
• Viscosity: How much effort is required to perform a single
change?
• Visibility: Is every part of the code simultaneously visible
(assuming a large enough display), or is it at least possible to
juxtapose any two parts side-by-side at will? If the code is
dispersed, is it at least possible to know in what order to read
it?
Role-expressiveness
• Can the reader see how each component of a
program relates to the whole?
• RE describes how easy it is to answer the
question ‘what is this bit for?’
• How to enhance RE?
1. By use of meaningful identifiers
2. By well-structured modularity
3. By the use of secondary notation (doesn’t contribute
to the running of the program, e.g., comments) to
signal functionally-related groupings
Dimensions Outline
• Role-expressiveness: Can the reader see how each
component of a program relates to the whole?
 Secondary notation: Can programmers use layout, colour, or
other cues to convey extra meaning, above and beyond the
‘official’ semantics of the language?
• Viscosity: How much effort is required to perform a single
change?
• Visibility: Is every part of the code simultaneously visible
(assuming a large enough display), or is it at least possible to
juxtapose any two parts side-by-side at will? If the code is
dispersed, is it at least possible to know in what order to read
it?
Secondary notation
• Can programmers use layout, color, or other
cues to convey extra meaning, above and
beyond the ‘official’ semantics of the
language?
• SN is carries extra information by other means
than formal syntax
Find examples of secondary notations
from this
Indenting
Commenting
choice of naming conventions
grouping of related statements
Dimensions Outline
• Role-expressiveness: Can the reader see how each
component of a program relates to the whole?
• Secondary notation: Can programmers use layout, colour, or
other cues to convey extra meaning, above and beyond the
‘official’ semantics of the language?
 Viscosity: How much effort is required to perform a single
change?
• Visibility: Is every part of the code simultaneously visible
(assuming a large enough display), or is it at least possible to
juxtapose any two parts side-by-side at will? If the code is
dispersed, is it at least possible to know in what order to read
it?
Viscosity: resistance to local change
• The ‘viscosity’ of a fluid is its resistance to
local change.
• V here means how much effort is required to
perform a single change?
• Why viscosity matter?
– changes and revisions infest the whole course of
programming activity, from specifying to designing
to coding
Dimensions Outline
• Role-expressiveness: Can the reader see how each
component of a program relates to the whole?
• Secondary notation: Can programmers use layout, colour, or
other cues to convey extra meaning, above and beyond the
‘official’ semantics of the language?
• Viscosity: How much effort is required to perform a single
change?
• Visibility: Is every part of the code simultaneously visible
(assuming a large enough display), or is it at least possible to
juxtapose any two parts side-by-side at will? If the code is
dispersed, is it at least possible to know in what order to read
it?
An example of high viscosity
Dimensions Outline
• Role-expressiveness: Can the reader see how each
component of a program relates to the whole?
• Secondary notation: Can programmers use layout, colour, or
other cues to convey extra meaning, above and beyond the
‘official’ semantics of the language?
• Viscosity: How much effort is required to perform a single
change?
 Visibility: Is every part of the code simultaneously visible
(assuming a large enough display), or is it at least possible to
juxtapose any two parts side-by-side at will? If the code is
dispersed, is it at least possible to know in what order to read
it?
Visibility
• Is every part of the code simultaneously visible (assuming a large enough
display), or is it at least possible to juxtapose any two parts side-by-side at
will? If the code is dispersed, is it at least possible to know in what order
to read it?
• Related to visibility is juxtaposability, the ability to see any two portions of
the program on screen side-by-side at the same time.
• A bad example:
– Spreadsheets, with their two layers (data and formulae), have
asymmetric visibility.
In-class activity
• Pick three of dimensions and evaluate
Yahoo!Pipes using them
(http://pipes.yahoo.com/pipes/)
• 10 minutes: register for a Yahoo! Account if
you don’t have one, and play with a couple of
pipes programs
• 15 minutes: go through the interface and
write down the problems you find for each
dimension.
Download