Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Documentation pulled out of code is only as good as the doc comments that have been written. It does have the advantage of making it far easier to write and maintain. If you're editing a function, if the documentation is just above then you're more likely to update it.

This from the Rust standard library is a good example - https://doc.rust-lang.org/std/result/index.html . I think that's great documentation, and it's entirely generated from the source code.

Most rust libraries won't have this level of explanatory detail, the core team have put a lot of effort into making it as easy as possible to learn, and documentation effort is part of that (the Rust book is another important part).

Something else that Rust does well is that 'examples' is a standard part of project layout. For libraries that haven't done their top level documentation well, the examples folder will usually give a good demonstration of how to use the code, and they usually exist because that's the easiest thing for the library author, and the usually compile because they're automatically built by `cargo build`.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: