2 ms·
I'm not sure the complexity of the borrowing rules are always essential. Sometimes it is, but often it adds an accidental layer of complexity that doesn't exist
by verdagon 4y ago
I'm not sure the complexity of the borrowing rules are always essential. Sometimes it is, but often it adds an accidental layer of complexity that doesn't exist in the real world.
For example, I once saw someone bring in an entire message-routing framework (Yew) because they couldn't get a simple observer to work within the borrow checker.
This is why I'm glad that Rust added Rc/RefCell; its design acknowledges that sometimes, the borrow checker gets in the way more than it helps, and it adds a more flexible alternative so we don't shoot ourselves in the foot by using the borrow checker in places where it doesn't make as much sense.