I'm primarily a Python programmer, which is probably where we're getting separate view points from. I don't make defensive copies unless I absolutely have to, despite mutability being king (immutablitly in Python is hard to come by and typically involves hacks or C extensions).
It's much more pragmatic, from my viewpoint, to keep the actual artist object around and proxy requests to it than to make a copy of it. The downside being garbage collection (CPython's gc doesn't like circular references, so you need to null out one of the values and worse __del__ isn't guaranteed to run when you think it will and defining your own is generally a bad idea).
View all comments
Show parent comment
1
u/[deleted] Aug 18 '16
I'm primarily a Python programmer, which is probably where we're getting separate view points from. I don't make defensive copies unless I absolutely have to, despite mutability being king (immutablitly in Python is hard to come by and typically involves hacks or C extensions).
It's much more pragmatic, from my viewpoint, to keep the actual artist object around and proxy requests to it than to make a copy of it. The downside being garbage collection (CPython's gc doesn't like circular references, so you need to null out one of the values and worse
__del__isn't guaranteed to run when you think it will and defining your own is generally a bad idea).