PEP308: a call for usability studies (was Re: Update to PEP308: if-then-else expression)

Paul Rubin http
Thu Feb 13 20:49:55 EST 2003


"Tim Peters" <tim_one at email.msn.com> writes:
> [Carel Fellinger, experiments on <shudder> people]
> 
> That's a wonderful report.  Thank you for sharing it (I won't repeat it
> here, but everyone do yourself a favor and read it).

I have to say that while I admire the spirit, these "usability
studies" involving non-Python programmers seem a little bit silly. 

Lots of the other stuff that's basic to Python, like the "self"
argument to class methods, the __init__ method, the ''.join(x) idiom, 
the range function (i.e. using "for i in range(1,11)" instead of
"for i = 1 to 10"), are all at least as non-obvious in their meaning
as most of the PEP 308 candidates we've discussed.

I'm also unconcerned that non-programmers (I mean complete
non-programmers, not just non-Python programmers) will have more to
get confused by when reading Python code, if there's another simple
construct in the language.  The problems they'll face will have more
to do with understanding the algorithms, function calls,
object-oriented methodology, etc.  No one who can understand classes
and simple inheritance (to say nothing of REALLY confusing stuff like
metaclasses) is going to have trouble understanding a conditional
expression.

Nor do I believe that keeping Python's syntax and keywords to a bare
minimum really makes Python easier to learn, where "learn" means
"acquire the ability to read and understand a nontrivial Python
program written by somebody else".  Minimalizing the language makes
more sense if Python is merely a "glue" language in which nontrivial
programs simply aren't written.  But these days, Python is used for
substantial applications.  Anyone trying to read one of them really
has to understand the more commonly used functions in the sys, os, and
regexp modules, maybe the math library, perhaps the socket libraries
or urllib or the cgi module or whatever else, depending on what the
application does.  And offering a wide selection of library modules is
an explicitly embraced feature ("batteries included") of Python's
philosophy.  It seems perfectly consistent to treat built-in features
the same way.  Of course the features should be designed cleanly,
just like library modules should be designed cleanly.

So I just don't see any reason to get uppity about fending off
language features that are present in so many other languages without
drawing complaints.  That includes not only conditional expressions,
but also case statements, repeat/until loops, etc.  Python seems
to be acquiring such features one by one (operators like += appeared
only recently) -- why not just realize that including them is logical,
and not make such a fuss?




More information about the Python-list mailing list