2 ms·
Thank you. That's exactly our thought process too, though there is some reasonable disagreement about it.
by steveklabnik 13y ago
Thank you. That's exactly our thought process too, though there is some reasonable disagreement about it.
- slight 13y agoI've been reading a bunch of tutorials and such, including the official one, about Rust recently and you'd get the impression that using unique pointers were the norm. This discussion seems to suggest they should be generally avoided. Now I'm not sure if I've just been massively misreading everything (I come from a background in GC languages) or whether the messaging about usage is way off.
- steveklabnik 13y agoWell, the official pointer tutorial, which I wrote, says right up front that you should prefer stack allocation: http://static.rust-lang.org/doc/master/guide-pointers.html http://static.rust-lang.org/doc/master/guide-pointers.html Unique pointers are one of Rust's newest, shiniest features, so they do get talked about a lot. Probably disproportionally so. Honestly, it's probably that the docs are still coming together. The tutorial is notoriously poor, Mozilla has hired someone to work on it, but the fixes haven't surfaced yet.
- slight 13y agoRe-read the pointer tutorial and yes I've clearly mis-remembered that so apologies! You're probably right that there's just a lot of discussion about them at the moment. Anyway I'm very excited about Rust, really looking forward to 1.0.
- slight 13y agoI've been reading a bunch of tutorials and such, including the official one, about Rust recently and you'd get the impression that using unique pointers were the norm. This discussion seems to suggest they should be generally avoided. Now I'm not sure if I've just been massively misreading everything (I come from a background in GC languages) or whether the messaging about usage is way off.
- LeFuneste 13y agoAs an early learner of Rust, but with strong experience in C++, I also agree with this choice. It seems much clearer to me than ~ and @. And thanks for the explanations and the tutorial !
- steveklabnik 13y agoAny time. Glad you like them.