News for hackers. Stuff that matters.
Re:Dave Herman’s contributions to Rust by chrismorgan on Friday May 07, 2021 @07:05AM (#27074574)
I steadfastly maintain what I’m saying.

RefCell allows you to get a mutable reference via an allegedly-immutable reference. That it goes via a guard type is quite immaterial. It breaks the model.

&mut implies & is immutable.

Rust is teaching an incorrect mental model, which I believe is the wrong mental model to teach. Sure, &uniq is not devoid of problems, because most of the time &mut will suggest the right thing for beginners. But the spelling &mut is categorically wrong at the fundamental technical level. It was never actually about mutability.

There are no comments on this comment yet.