473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

immutable data

What does the term immutable mean? Could you please explain me with
examples.

Jun 26 '07 #1
4 1042
cannot be changed

http://www.google.com/search?q=define+immutable
<bb****@yahoo.comwrote in message news:11*********************@x35g2000prf.googlegro ups.com...
What does the term immutable mean? Could you please explain me with
examples.

Jun 26 '07 #2
Hi,

.... immutable object is an object whose state cannot be modified after it
is created. This is in contrast to a mutable object, which can be modified
after it is created....
The source (and examples): http://en.wikipedia.org/wiki/Immutable_object

Alex
http://devkids.blogspot.com
What does the term immutable mean? Could you please explain me with
examples.


Jun 26 '07 #3
Hello bb****@yahoo.com,
What does the term immutable mean? Could you please explain me with
examples.
Google is your friend when looking for definitions....

Enter into google:

define:immutable object
Jun 26 '07 #4
"LOLRTFM"

immutable objects are significant because of how the compiler will
deal with them. for instance C# strings are immutable, so if you say

string s = "bl";
foreach (int i=0; i<10; i++)
s += "a";
s+= "h";

the end result is what you think it would be, but the compiler will be
creating lots more temporary strings in between.

"bla", "blaa", "blaaa" ... etc

if strings weren't immutable you wouldn't have as many temporary
objects, but things maintenance behind the scenes would be slower.
When objects are immutable the compiler has more assumptions to work
on and will be faster in the long run (assuming you avoid stuff like
the above). So if something is immutable you should be aware of
temporary object creation getting out of hand.

Jun 26 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Zalek Bloom | last post by:
I am learning about difference between String and StringBuffer classes. In a book it sayes that a String class is immutable, that means that one an instance of String class is created, the string...
7
by: Torsten Mohr | last post by:
Hi, reading the documentation (and also from a hint from this NG) i know now that there are some types that are not mutable. But why is it this way? From an overhead point of view i think...
48
by: Andrew Quine | last post by:
Hi Just read this article http://www.artima.com/intv/choices.html. Towards the end of the dicussions, when asked "Did you consider including support for the concept of immutable directly in C#...
22
by: Ben Finney | last post by:
Howdy all, I've recently packaged 'enum' in PyPI. In its description, I make the claim that it creates "immutable" enumeration objects, and that the enumeration values are "constant" values. ...
2
by: yccheok | last post by:
I have an immutable object, where I do not provide implementation on =operator. However, I am facing a problem when trying to use it with stl map. stl map requires the object to have =operator...
90
by: Ben Finney | last post by:
Howdy all, How can a (user-defined) class ensure that its instances are immutable, like an int or a tuple, without inheriting from those types? What caveats should be observed in making...
3
by: Sam Kong | last post by:
Hi group, I want to have some advice about immutable objects. I made a constructor. function Point(x, y) { this.x = x; this.y = y; }
16
by: fallenidol | last post by:
how do you create an immutable object in c#? thanks in advance
16
by: InDepth | last post by:
Now that .NET is at it's fourth release (3.5 is coming soon), my very humble question to the gurus is: "What have we won with the decision to have string objects immutable? Or did we won?" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.