What Developers Really Want from Documentation
Here are studies from scientists at Merseburg University of Applied Sciences which I summarized in this article:
- Application Programming Interface Documentation: What Do Software Developers Want?, 2018
- API Documentation Optimization: Some Guidelines & Effects, 2020
The studies shed light on the nuanced preferences of developers, offering valuable insights for future API documentation endeavors.
What do developers want?
In the first study, researchers collected the experiences and opinions of developers to understand their approach to learning a new API: what information they seek, what resources they use, and what hinders them.
Developers were asked to share their experiences with APIs and documentation. Based on these insights, a survey was conducted with other developers to confirm that the information from the initial interviews was relevant and important for all developers.
The research reveals that developers approach new APIs with two different goals:
- To understand whether to choose the API for a specific task.
- To use the API to perform tasks.
Regardless of the goal, the first thing developers want to know when starting to work with an API is a brief overview of what the API is and what tasks it can be used for. After that, opinions diverge:
- Quick starters: Developers who want to begin coding immediately. They look for examples that could serve as a basis for solving their problem.
- Understanding first: Developers who prefer to understand the API before starting work. They search for and read API documentation, such as an overview of technical architecture explaining common concepts. They approach documentation based on the problem or task at hand.
Challenges developers face
Developers often encounter problems when studying APIs:
- Inaccurate or error-filled documentation
- Unclear documentation
- Difficulty finding information (e.g., determining how the API should be used to solve a specific problem or where to start)
If developers encounter a problem, most will Google it, with only 30% reading the documentation.
What to do about it?
Drawing from the insights of the first study and research by other authors, the second study formulated recommendations for API documentation and tested their effectiveness.
Researchers revamped a real API’s documentation and assigned developers tasks using the API:
- Some developers received the old documentation
- Others received the new, improved documentation
The study measured:
- Accuracy of task completion
- Time spent on tasks
- Time spent consulting documentation and external resources
Results
- Developers who used the new documentation made fewer mistakes.
- Task completion times were roughly the same.
- Time spent reading documentation did not differ, but developers using the old documentation spent more time consulting other resources, leading to higher overall effort.
Feedback from developers indicated that both sets of documentation have room for improvement.
Conclusions
The research emphasizes the importance of user-friendly API documentation. Recommendations from the second study align with industry best practices, such as Tom Johnson's Documenting APIs: A guide for technical writers and engineers.