Design of intuitive interfaces

Norbert Nemec Norbert at Nemec-online.de
Sat Feb 20 23:15:23 PST 2010


Hi there,

lately, there was some heated discussion about the naming of functions 
in the standard libraries. Rather than chiming in, I'd like to share 
some very general thoughts about this.

Writing *intuitive* interfaces, be it for libraries or applications, is 
a very different issue than writing *correct* or *efficient* software. 
The most important difference is, how to react to to user feedback.

In terms of correctness or efficiency, each single feedback is either 
right or wrong, so you can easily argue about its validity.

Feedback about the intuitiveness of an interface, on the other hand, is 
by definition always right. After all it is a message from a user: "I 
had the following experience." Of course, there is still plenty of room 
to discuss it (wouldn't it be boring if there was nothing to talk 
about?) but it cannot be argued away. For one person speaking up, there 
are often many others experiencing the same thing and keeping silent.

As for function naming: intuitive names are an essential aspect of the 
quality of a library. Of course, one could use a Russian library without 
understanding any of the names, but it would be a painful experience.
Good function names should give a rough idea of their meaning and, more 
important, they should me memorable after reading the docs once.

Commercial software design spends lots of time and money on field 
studies, doing statistics (yes, statistics!) on user feedback. Not 
having these resources, we have to make assumptions on our target user's 
background. Every interface has to be designed towards an audience. If 
it fails to address this audience, it will fail.

Trying to imagine a "typical" user of the D library, I see a 21st 
century person with reasonable knowledge of the English language and 
some background other mainstream programming languages. Seeing the word 
"retro" that person will think "old style" rather than picking up the 
dictionary and looking up the original meaning. Seeing "iota", the 
person will think "???".

No matter how good the explanation for any library name is, the fact 
that you have to give the explanation indicates that it is not 
intuitive. Now, of course, intuitivity is not everything. Conciseness is 
very important. Sometimes, introducing a new word is a good solution. 
Think of it as introducing a new technical term in writing an article or 
a book. Introducing a term that you cannot assume to be known by the 
audience, you first have to give an explanation. Doing so, you have to 
consider: is it worth introducing this term? Is it really more concise 
than using something known?

OK, now, before this whole post begins to sound constipated, I'd rather 
finish by giving my own user feedback about the function names that were 
discussed.

The name "retro" feels awkward to me as well. As this is a matter of 
in-place vs. input-preserving, I would suggest the solution in Python/NumPy:

"sort" gives the command to sort data in-place
"sorted" returns a sorted data, preserving the input

similarly, I would suggest

"reverse" to sort in-place
"reversed" to return a modified copy

The name "iota" seems confusing to me as well. Very few greek letters do 
indeed have a conventional meaning (e.g. lambda-calculus, delta for a 
difference or epsilon for a really small value). Calling a function by a 
meaningless name is not a good idea. Don't have a better idea right now, 
though...

But as I said, usability really is about the "average" member of the 
audience, so this is really just one voice out of many.

Greetings,
Norbert



More information about the Digitalmars-d mailing list