Each may have a different purpose conceptually but in reality they all contain useful information that all put together gives a better and more whole picture. Furthermore, isn’t it a nightmare keeping different documents up to date? The standard API docs are just about perfect because they are searchable and have a good mixture of explanation and examples. However, since other sources exist, I would like to see this organized into one location.
Some examples of the problem
- The Book has longform writing but also has several examples. It also usually links to the API documentation or other references throughout a particular section.
- RustByExample contains lots of stuff the Book does not. For example, I could not find anything about HashMap in the Book(and had no way to search) for it if it was bundled in somewhere I would not expect.
- RustByExample has a section about Threads. The Book’s section is called Tasks.
-
http://rustbyexample.com/staging/hash.html has a broken link at the bottom to Wikipedia
To me, the ideal document would have the 1 2 3 4 5 hierarchy the Book has and filled in with the RustByExample hierarchy within those levels. The body of the particular topic would consist of what the Book has. The top has a table with links to the API(if applicable) or general domain information. More examples and Reference(specification) is folded into this document as it’s own section.
Eliminate the Reference document(as a separate doc).
Eliminate RustByExample.com or have it point to this new document.
Keep documentation DRY the same as you would code.
Example of a section:
Iterators
API: http://doc.rust-lang.org/std/iter/
Domain Info: http://en.wikipedia.org/wiki/Iterator
Futher Reading
Specification: Spec(bottom of page)
More Examples: Examples(bottom of page)
Let’s talk about loops.
…