3 ms·
I don't see how understanding pointers and memory layout help at all with borrowing concepts.
by Thaxll 4y ago
I don't see how understanding pointers and memory layout help at all with borrowing concepts.
- aparsons 4y agoThey don't. They're fairly orthogonal concepts. You can have a concept of lifetimes without memory management (for example, the object changes state while you have a reference to it).
- voidhorse 4y agoIt provides historical context. Someone coming from a gc langage that has never even had to learn what memory even is wrt to a program will not understand why a borrow checker is even a thing. You can get very far writing software without even being aware that your language is even doing something called garbage collection for you, or without even having a basic concept of memory being tied to values, sizes, etc. If you lack this context a borrow checker just seems like a pointless nuisance.
- matthews2 4y agoIf you are writing C or C++ and aren't thinking about ownership and lifetimes, you have either statically allocated everything or you are doing it wrong.