3 ms·
> This means that in order to write C++, you effectively have to memorize the undefined behavior rules, which sucks. > This means, to be a highly productive Ru
by Ygg2 2y ago
> This means that in order to write C++, you effectively have to memorize the undefined behavior rules, which sucks.
> This means, to be a highly productive Rust programmer, you basically have to memorize the borrow checker rules, so you get it right the first time. This is stupid, because the whole point of having a type system or a borrow checker is to tell you when you get it wrong
I'm not sure how you want to square this circle, you don't want to memorize the rules of UB, but you also don't want for compiler to correct you when you make UB behavior according to Borrow Checker?
The best way in both C++ and Rust is to structure your tree of lifetimes and use other means to achieve your desired goal.
- recursivecaveat 2y agoThey just don't want the borrow checker errors to only come after type checking. You have to know the rules well because otherwise you're going to finish a big refactor only to find out afterwards it was never going to work.
- Ygg2 2y agoThat's one of their issues. Other issues are borrow virality and stuff for next Rust.