On Fri, Jun 17, 2011 at 10:05 AM, Kirk <kirk.pepperd...@gmail.com> wrote: > If you don't want something to change the internal state, don't export it. >
Hmm... sounds like you are talking more about complex datastructures. I'm typically more concerned with immutability in value types. And, I ultimately wouldn't even care if the actual representation of the String I'm using is mutated behind me. Interned for example. What I care about is the value that I get when I use it stays the same. This is similar to the GC argument. I don't care if my object stays put in memory after I construct it. Only that I always get back to the same object when I reference it. Now, I know there are "persistent" datastructures. My understanding is the majority of those actually use mutations behind the scenes. (At least the complex ones. I confess I have not read all of Functional Datastructures. Much less understood it.) -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javaposse@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.