4 ms·
Yeah for me it's more around the ergonomics (and imprecision) about using indexes. It's a perfectly workable approach, but passing around offsets feels like I'
by skohan 5y ago
Yeah for me it's more around the ergonomics (and imprecision) about using indexes.
It's a perfectly workable approach, but passing around offsets feels like I'm breaking the contract a bit. The compiler doesn't know which index goes with which data structure, I'm just asking the compiler to trust me that I'm pairing them correctly.
Also it tends to be more boilerplate than just having a direct pointer stored inside the data structure.
Don't get me wrong, I understand all the problems with pointers, but it the UX is better in a lot of cases.
- db48x 5y agoIndices don’t need to be imprecise. In Rust at least you can give different types for different indices, so that you cannot mix them up.