[Edu-sig] Properties use case

Scott David Daniels Scott.Daniels at Acm.Org
Thu Mar 23 23:48:38 CET 2006


Christian Mascher wrote:
> Scott David Daniels wrote:
> 
>> copying to a minimum.  With immutables, you needn't do any of the
>> bookkeeping.  It is not that you have gone terribly wrong; it is that
>> you have opened the lid on a large class of avoidable problems.  If you
>> look at Java's strings (as I remember -- it has been forever since I
>> studied Java at all), you will find they are mutable.  You also find
>> that Java code copies strings a _lot_, just to be safe against lower-
>> level mutation.
> 
> Incidentally, Java's strings are immutable, too. Quote from "Head First 
> Java" (p. 589):
> 
> "For security purposes, and for the sake of conserving memory 		... 
> Strings in Java are immutable."

Sorry about the mis-information, it has been too many years since I
looked at Java.  Perhaps I was remembering Pascal or Ada.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Edu-sig mailing list