views:

109

answers:

8

I'm working on the dreaded last stage of a project: documenting the API for a semi-technical audience.

I'm wondering: what API docs have you found to be particularly elegant?

Note that this has nothing to do with how elegant the API itself is: this is purely a question of the formatting/appearance of the API docs themselves. Which language or API docs convey their information in the most intuitive and readable way?

+1  A: 

Two off the top of my head:

meder
+2  A: 

Python has very compact, but amazingly clear documentation:

http://docs.python.org/index.html

gahooa
A: 

A negative answer from me - just to document what I've found horrible.

Maybe it is just a case of living mostly in Microsoft land but I've never seen an API documentation language that I can read as easily as code.

The two documentation sources I read regularly are the SQL Server Books Online and the MSDN C# documentation. I absolutely loathe the technical documentation langauges employed on both. I find that almost 100% of the time I dive straight to code examples.

For example, below is a few lines from the t-sql reference on select - I write select statements every day yet really struggle with this:

SELECT statement ::= 
    < query_expression > 
    [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } 
        [ ,...n ]    ] 
    [ COMPUTE 
        { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ] 
        [ BY expression [ ,...n ] ] 
    ] 
    [ FOR { BROWSE | XML { RAW | AUTO | EXPLICIT } 
            [ , XMLDATA ] 
            [ , ELEMENTS ]
            [ , BINARY base64 ]
        } 
]

It is only in the case of wanting to dig into a very detailed or edge case requirement that I ever take the time to relearn to details of the documentation language. But for myself at least, the actual documentation syntaxes evaporate once they've served their need.


EDIT - I felt the need to be a little bit positive about MSDN, I use it most every day and find it to be a great wealth of information, but it is generally the code samples and the explanatory text, not the API documentation that give me the information that I need.

David Hall
Yeah, I hear that. I had a colleague show me the MSDN before I asked, didn't like the look of it.
CarlG
Just to let you know. Code examples are documentation. They do not appear magically by themselves in topics. Writers create both text and code example that demonstrate how to use a certain feature/class/method/etc.
Alexandra Rusina
@Alexandra - Well, yes, of course they are. The addition of good code examples and explanations is where the Microsoft documentation has really improved over the years IMO. That's the point I'm trying to stress - for me documentation without good code examples and explanatory text is seldom enough. For example, I've always found the technical language in t-sql syntax examples very hard to read, much prefering the code examples.
David Hall
+2  A: 

Django.

FogleBird
A: 

Python's documentation is my favorite.

chills42
+2  A: 

I'm going to have to go with the MSDN Library. They do a particularly good job of documenting pre/post conditions of methods and excellent consistency across a HUGE set of APIs.

280Z28
+1  A: 

Flex...I really find this sort of setup perfect.

Tegeril
Yeah, that is nice. Very similar to javadocs, which I'm also a fan of.
CarlG
+2  A: 

I've always liked the javadocs and tutorials for the Java standard library.

Loadmaster