3 ms·
You mean like how Vec has a ton of examples? https://doc.rust-lang.org/std/vec/struct.Vec.html https://doc.rust-lang.org/std/vec/struct.Vec.html FWIW I'm not
by vvanders 9y ago
You mean like how Vec has a ton of examples?
https://doc.rust-lang.org/std/vec/struct.Vec.html https://doc.rust-lang.org/std/vec/struct.Vec.html
FWIW I'm not a huge fan of Python's docs because I can't quickly scan them to track down that one detail about a function I was using.
Rust's docs also let you collapse everything which makes browsing them much faster.
- andromeduck 9y agoThe traits implementation section is god awful and in an utterly unusable order because the ordering makes no sense. I find myself always just looking at the source to make sense of things rather than the docs which kind of defeats the point.
- vvanders 9y agoThat's because the trait section only shows what traits a type implements. If you want to see how to use a trait just click that trait's name for the trait specific documentation.
- Paul-ish 9y agoSometime I don't know what trait I need, but I do know what kind of operation I want. In documentation such as Python's, I can "ctrl + F" for word similar to what I want to do and I usually find what I need. In rust, that textual description is usually hidden on the trait's page. This is probably more frustrating to beginners who don't know what most of the basic traits are. In general though, the standard library is better about this than other libraries.
- steveklabnik 9y agoThe built-in Rustdoc search isn't perfect, but it should search the textual description for you. It might only search the first line? I should dig into that code again...
- b0rsuk 9y agoExcept that for some types traits form the bulk of functionality. Sorry I can't remember off top of my head, I'm a Rust novice.
- b0rsuk 9y agoVec may have examples, but lots and lots of other pages don't, and people learn by example. Python library writers add documentation similar to what they're familiar with. Rust library writers are going to document in a way that resembles typical Rust documentation. That's why I was careful to call it different, not bad. Coming from Python it's a culture shock. They are very different ways of handling documentation, and I take into account the docs are under construction. I'll try to get more used to it, see how it develops, and then form an opinion. So far Rust docs are awkward to use for me.