I guess since my objects have usually very short-lived life cycles, I'm not too worried about the value of a reference being changed over time. I can see how that would be a major issue in a long-lived application where instances might frequently be reused.
From your perspective, it seems that immutability prevents the burden of defensive copies (or maybe it doesn't?) but having that allows you to trust references to be the only test you need for the notion of sameness to another object. Is that correct?
I have read Josh's book, it's a great work; I can tell there things in there that I will only really learn the import of down the road. |