[Python-Dev] 308: the debate is petering out
Raymond Hettinger
python@rcn.com
Tue, 18 Feb 2003 19:54:59 -0500
> Raymond, have any new proposals been suggested and not shot down?
I've been away from the keyboard for three days and will need this
evening to get caught-up on all the posts. If something new and
wonderful came-up, I'll update the PEP.
> Somebody mentioned usability studies. Did anything come out of that?
Yes. A bunch of people tried out the various forms on children,
significant others, and employees.
* In general, all of the forms were decipherable by people who already
knew Python.
* The c?a:b form was understandable to people familiar
with other languages. With a single example, others were able
to understand the form and found it easy to use. The surprise
was that the n-ary form (using parens for sub-expressions)
managed to confuse even non-beginners. The best guess at the
cause is that the grouping and precedence cues for parentheses
do not mix well with the concepts of grouping by ternary operator
and of short-circuit evaluation.
* The (if c: a else: b) form stumped some of the victims.
In some experiments, this was especially surprising because
they had just seen one of the other forms and had some expectation
of what it was supposed to do. The root problem appears to be
the blurring of the line between statements and expressions where
the keyword and colon cues proved misleading. On the plus side,
everyone who understood the ternary version had no problem with
the n-ary version.
* The c then a else b form was understood by most though a few
thought it looked unnatural in longer expressions. There were some
who understood it but could not make the jump to the n-ary form
(using the elif keyword). It appears that the colons help to visually
parse the n-ary form.
Raymond Hettinger