Hacker News new | ask | show | jobs
by ImaCake 2513 days 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.

1 comments

I 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.
Or you could use functional persistent data structures for your stdlib types, like Erlang’s map. (Essentially, “reference on read, amortized copy on write.”)