Developers are users too — Introduction
Usability — learning from the UI, applying in API
When talking about usability, we tend to think of user interfaces, may it be a maps, messaging or photo sharing app. We want our user interfaces to have several qualities, for example a maps application should be:
- Intuitive — to be able to easily know how to navigate from A to B.
- Efficient — to get the navigation directions quickly.
- Correct — to get the right path from A to B, without any roadblocks or other impediments.
- Provide appropriate functionality — be able to explore the map, zoom in, zoom out and navigate.
- Provide appropriate access to the functionality — be able to zoom out, by just pinching the map.
We should expect the same qualities from the APIs we work with too. If the UI is the interface between users and functionality, then the API is the interface between the developer using it and the body of code that implements that functionality. APIs, like UIs, need to be usable as well.
Libraries, frameworks, SDKs — APIs are everywhere! Whenever you’re separating code into modules, the classes and methods exposed by the module become the API. It’s what other developers (and ‘future you’!) need to work with.
Usability can be measured to be the inverse of the amount of time needed to understand how to use something. Both beginner and expert developers spend a lot of time learning how to work with new APIs. A low degree of usability leads to incorrect usage of APIs, which can result in bugs and even security problems. These issues end up affecting not only the developers integrating those APIs, but also the users of those applications. That’s why it’s critical to provide a usable API.
- Visibility of system status
- Match between system and the real world
- User control and freedom
- Consistency and standards
- Error prevention
- Recognition rather than recall
- Flexibility and efficiency of use
- Aesthetic and minimalist design
- Help users recognize, diagnose and recover from errors
- Help and documentation
In the next articles, we’ll take a look in depth at each of these principles and examine how they might be applied to API design. Stay tuned!