4 ms·
> It's more that Rust is just difficult for many to actually work with. I don't mean 'learn' in the absolute beginner sense. There's no shortage of excellent an
by estebank 4y ago
> It's more that Rust is just difficult for many to actually work with. I don't mean 'learn' in the absolute beginner sense. There's no shortage of excellent and generously accessible materials (the Rust Book amongst others). They're not that difficult to get through.
This is something that I noted when I first picked up the language: The rationale and explanations made sense, I could "learn" the rules, but in practice it was much harder, because I hadn't internalized the rules, nor fully grasped the consequences of those rules.
Having said that, I wish someone had told me ".clone() early, .clone() often" and "only return borrows if they are borrowing from an argument, otherwise use owned values" for the first 3 to 6 months. Having to learn the intricacies of borrowed values and a whole FP-inspired systems language at the same time is a lot.
- oconnor663 4y ago> Having said that, I wish someone had told me... Another rule of thumb I always try to emphasize for beginners: Don't add lifetime parameters to your structs. Sometimes the compiler will suggest that you do it, but ignore those suggestions. Concretely, always make your structs hold String or Vec instead of slices. In 3-6 months you can ignore this rule.
- Ygg2 4y ago> ".clone() early, .clone() often" Make your types Copy. Don't even worry about cloning. That said, there are few things you want to have lifetimes, and in that case you want to de-elide lifetimes. As practice.