5 ms·
Interesting, if there's one thing I really don't miss in Rust it's bloody headers. Can't you simply use the docs? When I code in Rust I generally have the docs
by simias 9y ago
Interesting, if there's one thing I really don't miss in Rust it's bloody headers.
Can't you simply use the docs? When I code in Rust I generally have the docs opened: https://doc.rust-lang.org/std/vec/struct.Vec.html https://doc.rust-lang.org/std/vec/struct.Vec.html (or more like likely the locally installed version).
Most crates have documentation available as well (generally linked directly from their entry on crates.io) and if it's not online for some reason you can just run "cargo doc" to generate it locally. Randomly taking the "image" crate as an example: https://docs.rs/image/0.17.0/image/ https://docs.rs/image/0.17.0/image/
Beats grepping header files IMO.
- jcelerier 9y ago> Beats grepping header files IMO. who greps header files in 2017 (or even 2010) ? just fuzzy search a few characters that more or less looks like what you want in your IDE's search box.
- jstimpfle 9y agoI still grep header, as well as implementation, files a lot. I miss being able to fuzzy search sometimes, but I keep coming back to vim. IDEs just don't cut it for me. They are too slow (Visual Studio 2017 on my desktop from 2011 is unbearable for even starting a new project). And most things I really need to do - in vim they are a few memorized keypresses or a plain shell command in a Makefile away, while in IDEs I have to dig through wizards which really brings me out of the zone. Not relying on API search much has the huge advantage of not relying on external APIs, which leads to good modularization. As a general rule, a module shouldn't call into other modules much. And by the way it's the same for OOP: OOP has the advantage of supporting IDE member/method autocomplete (noun first syntax), but it's just the wrong mindset for me and leads to really broken architectures.
- wasted_intel 9y ago> Not relying on API search much has the huge advantage of not relying on external APIs, which leads to good modularization. As a general rule, a module shouldn't call into other modules much. When writing Rust, you'll likely use the standard library a lot; this rule might not be as applicable as in other languages/environments.
- jstimpfle 9y agoWhat kind of use do you mean exactly?
- wasted_intel 9y agoData structures (vectors, hashmaps, trees), I/O, etc. are all part of the stdlib, and their rich feature sets make an API reference essential. You can certainly write Rust without it, but you’d be missing out on a lot of useful functionality.