¡@

Home 

c# Programming Glossary: immutable

Why .NET String is immutable? [duplicate]

http://stackoverflow.com/questions/2365272/why-net-string-is-immutable

.NET String is immutable duplicate This question already has an answer here Why can't.. Java and .NET 16 answers As we all know String is immutable. What are the reasons for String being immutable and the introduction.. String is immutable. What are the reasons for String being immutable and the introduction of StringBuilder class as mutable c# .net..

Why is lock(this) {…} bad?

http://stackoverflow.com/questions/251391/why-is-lockthis-bad

use strings as the keys in lock statements since they are immutable and are shared accessible across parts of the application. You.. subject You should avoid locking on strings since they are immutable. if Monitor.TryEnter person.Name 30 false Console.WriteLine..

Why are mutable structs evil?

http://stackoverflow.com/questions/441309/why-are-mutable-structs-evil

any other copies which might be around. If your struct is immutable then all automatic copies resulting from being passed by value..

When to use struct in C#?

http://stackoverflow.com/questions/521298/when-to-use-struct-in-c

on . It has an instance size smaller than 16 bytes. It is immutable. It will not have to be boxed frequently. Microsoft consistently.. is any attempt or proof of requirement to keep structs immutable or maintaining an instance size of only 16 bytes or less Nothing.. less Nothing in the structs above is declared readonly not immutable Size of these struct could be well over 16 bytes Entry has an..

C# Events and Thread Safety

http://stackoverflow.com/questions/786383/c-sharp-events-and-thread-safety

be executed because it'll be a new list. Delegates are immutable. As far as I can see this is unavoidable. Using an empty delegate..

Immutable object pattern in C# - what do you think?

http://stackoverflow.com/questions/263585/immutable-object-pattern-in-c-sharp-what-do-you-think

object pattern in C# what do you think I have over the course.. immutable readonly objects and immutable object graphs. Immutable objects carry the benefit of being 100 thread safe and can therefore.. MakeReadOnly immutable true protected virtual void FailIfImmutable if immutable throw new ImmutableElementException this ... Let's..

Difference between string and StringBuilder in c#

http://stackoverflow.com/questions/3069416/difference-between-string-and-stringbuilder-in-c-sharp

bar foo.Replace 'o' 'a' string baz foo bar ditto here Immutable objects have some nice properties such as they can be used across..

Efficient, Immutable, Extensible Collections for .NET [duplicate]

http://stackoverflow.com/questions/3485262/efficient-immutable-extensible-collections-for-net

Immutable Extensible Collections for .NET duplicate This question already.. .NET duplicate This question already has an answer here Immutable collections 10 answers It seems to me there is an extreme..

Why are C# structs immutable?

http://stackoverflow.com/questions/3751911/why-are-c-sharp-structs-immutable

and reads on another immutable objects don't have writes. Immutable objects can be taken apart and re used. For example if you have..

Choosing between immutable objects and structs for value objects

http://stackoverflow.com/questions/575977/choosing-between-immutable-objects-and-structs-for-value-objects

object or a struct I think your options are wrong. Immutable object and struct are not opposites nor are they the only options...

Pure functions in C#

http://stackoverflow.com/questions/592934/pure-functions-in-c-sharp

in .NET 4 might introduce these Microsoft is using Immutable and Pure inside .NET 3.5 framework right now. For example see.. framework right now. For example see Microsoft.Contracts.Immutable and Microsoft.Contracts.Pure inside .NET 3.5 in the System.Core.dll... pre release .NET 4.0 bits contain any APIs like Pure or Immutable in the Contracts APIs. If they do I'd imagine the static analysis..

Creating a Math library using Generics in C#

http://stackoverflow.com/questions/63694/creating-a-math-library-using-generics-in-c-sharp

Type typeof T .ToString is not supported by Fraction. Immutable impementations are better. public T Numerator get private set..

Immutable collections?

http://stackoverflow.com/questions/927181/immutable-collections

collections I am making most of my basic types in my app immutable...

Can structs contain references to reference types in C#

http://stackoverflow.com/questions/945664/can-structs-contain-references-to-reference-types-in-c-sharp

bar's list has now changed too Mutable structs are evil. Immutable structs with references to mutable types are sneakily evil in..