3 ms·
>Some assignments copy the data and some create references and you need to memorize the conventions of which does what? This is a nightmare for beginner coders
by ImaCake 7y ago
>Some assignments copy the data and some create references and you need to memorize the conventions of which does what?
This is a nightmare for beginner coders trying to make sense of Pandas or R subsetting.
- bachmeier 7y agoI don't think there's any way to avoid that. You could always copy, but then you'd sacrifice performance. You could always make a reference, but then other parts of the language would become really complicated.
- derefr 7y agoOr you could use functional persistent data structures for your stdlib types, like Erlang’s map. (Essentially, “reference on read, amortized copy on write.”)