3 ms·
I am not sure as I haven't seen the entire codebase, but it is hard to understand why anyone would write rust like that. Heavy use of a construction like Rc<Re
by steeleduncan 9y ago
I am not sure as I haven't seen the entire codebase, but it is hard to understand why anyone would write rust like that.
Heavy use of a construction like Rc<RefCell<Box<_>>> is often a sign that someone is trying to replicate something like c++'s std::shared_ptr<_> in rust rather than write code in a manner idiomatic to rust. Also, given that the article's second point results from a confusion between a memory slice and an array, it is difficult to see this as an informed discussion of rust.
- flohofwoe 9y agoIME it's the typical code after a few hours of "fighting the borrow checker" if you didn't plan your data layout very carefully with the borrow checker restrictions in mind.
- nine_k 9y agoThat is, it's a lack of experience and understanding. The same way, you can see a lot of casts and `instanceof` use in code of those who don't understand types / classes yet, or a lot of global variables in code of those who don't understand functions / procedures yet. If something in a language feels badly wrong, it's often a good idea to ask experienced people, or even the language's authors.