Mutable value types are evil! Sort of...
Read OriginalThis technical article examines the concept of mutable value types (structs) in C# and .NET. It explains why they are generally considered problematic due to copy semantics, using examples with DateTime and custom structs. The article also discusses why the .NET framework uses them in specific scenarios, such as in List<T>.Enumerator, primarily for performance optimization.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser