Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

66%
+2 −0
Q&A What are the benefits of including complete working code samples in documentation

The purpose of API documentation is to explain how to use the API. Providing sample code of how to use key features is a good way to demonstrate the intended usage. A good example of this is the ...

posted 7y ago by sphennings‭  ·  last activity 5y ago by System‭

Answer
#3: Attribution notice added by user avatar System‭ · 2019-12-08T08:04:45Z (almost 5 years ago)
Source: https://writers.stackexchange.com/a/33591
License name: CC BY-SA 3.0
License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision by user avatar sphennings‭ · 2019-12-08T08:04:45Z (almost 5 years ago)
The purpose of API documentation is to explain how to use the API. Providing sample code of how to use key features is a good way to demonstrate the intended usage.

A good example of this is the [ZMQ guide](http://zguide.zeromq.org/page:all). It has example code in a large number of languages to go with each of the of the concepts discussed.

They combat the bloat by displaying links to the example code in every language the library is supported in. Only when a link is clicked on is the code displayed.

#1: Imported from external source by user avatar System‭ · 2018-01-25T21:00:25Z (almost 7 years ago)
Original score: 2