3 ms·
I would steer you away from Rc and Arc unless you know you need them.
by saagarjha 7y ago
I would steer you away from Rc and Arc unless you know you need them.
- hathawsh 7y agoPerhaps. I can think of a couple reasons to steer people away from Rc/Arc: they are less efficient than references and they don't support cyclic garbage collection. On the other hand, Rc/Arc are very helpful for newcomers coming from garbage collected languages and they can be more efficient than cloning. If I asked an employee to convert some high level module to Rust and that employee used a lot of Arcs where they weren't really necessary, I would say that employee had done a reasonably good job.
- pjmlp 7y agoThey are unavoidable with most GUI bindings on Rust, actually it is a plethora of Rc<RefCell<>> across the code.