7 Designing a concise and well-organized API
This chapter covers
- Organizing an API’s data, feedback, and goals
- Managing the granularity of data, goals, and the API
Now that you know how to design straightforward and predictable APIs, we have one last thing to cover in order to be sure we’re designing usable APIs. TV remote controls sometimes look intimidating with their numerous and not always well-organized buttons. Some microwave ovens or washing machines offer far too many functions for mere mortals. Overwhelming, disorganized, indistinct, or motley everyday interfaces, at best, puzzle their users and, at worst, frighten them.
“Less is more” and “a place for everything and everything in its place” are two adages that every API designer should apply. Organizing and sizing an API’s data, feedback, and goals is important in order to provide an API that can be easily understood and will not overwhelm users. If this is not done, all that we have learned about creating straightforward and predictable APIs is worth nothing.
7.1 Organizing an API
If you have ever used a TV remote control, you should be able to understand the meaning of any button on the four examples shown in figure 7.1. All of them propose exactly the same functions, using 15 buttons; but, depending on the buttons' organization, the usability goes from terrible to perfect.
Figure 7.1 The organization of a TV remote control’s buttons affects its usability.