Interface design: What to consider

As a back-end developer, the code you write is meant to be primarily consumed by other developers in writing their services. To this end, you would want to know how well written the interface is. This information will give you a sense of the adoption levels for your service.

Today we will take a quick dive into some of the measures that you can use to evaluate your interface design.

Conciseness

A concise interface enables maximum action with the smallest number of commands. To illustrate this point imagine inputting data to your program. You have the option of either

  1. Keyboard
  2. Screen Display of characters

In this example, typing in the keyboard is clearly more concise. You can get input data far more quicker.

Another way to think of the problem is by comparing programming languages

Java

public class HelloWorld
{
    public static void main (String[] args)
    {
        System.out.println("Hellold!");
    }
}

PHP

echo "Hello world";

Clearly PHP is more concise.

Expressiveness

Expressiveness describes the interface’s ability to command a wide variety of actions in its domain. This effect can be more readily seen in specialist fields. For example if you are writing code or library for AI, a specialist language like prolog maybe more suited to the task than a more general purpose language.

Prolog

likes(mary,food).
likes(mary,reading).
| ?- likes(mary,food). 
 yes.

PHP

function likes($item,$subject,$person,$database){
       return array_search($item,$database[$person][$subject])!==false; 
}
$mary=["likes"=>['food','reading']];
$people=['mary'=>$mary];
echo likes('food','likes','mary',$people);

And prolog shines for even more complex conditionals.

Ease of use

This relates to how many things a developer must know in order to use your code.

If your application has a GUI interface then this is rather low since the knowledge required can simply be summed up to point and click. However TUI applications ease of use drops significantly.

This is not to say that TUIs are bad, in a different context, say if your application is being used as a service library then a TUI interface is great for ease of use.

Transparency

This boils down to your application. It should not only be doing the right thing, but must also be seen to be doing the right thing.

You can greatly improve on transparency by providing useful feedback to the user, providing solid error management, well written error messages, intermediate results etc.

It would also help a lot if you ship your code source as well.

Discover-ability

Your application can be considered discover-able if it assists the user to master it. Comments, context sensitive assistance, Doc Blocks etc ensure that it is easy for the developer to find out what they don’t know about your application.

If a convention, best practice or standard exists for expressing or solving the particular problem, use it.

What do you normally consider when developing the interface for your service? Talk to us on the comment section below.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Published by

jchencha

Software Project Manager