<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Why Are Mutable Value Types Even Possible?</title> <atom:link href="http://davybrion.com/blog/2009/05/why-are-mutable-value-types-even-possible/feed/" rel="self" type="application/rss+xml" /><link>http://davybrion.com/blog/2009/05/why-are-mutable-value-types-even-possible/</link> <description>inquisitive: adjective. given to inquiry, research, or asking questions; eager for knowledge; intellectually curious</description> <lastBuildDate>Wed, 08 Feb 2012 11:42:42 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Daniel Earwicker</title><link>http://davybrion.com/blog/2009/05/why-are-mutable-value-types-even-possible/comment-page-1/#comment-15674</link> <dc:creator>Daniel Earwicker</dc:creator> <pubDate>Mon, 18 May 2009 09:56:48 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1352#comment-15674</guid> <description>Structs seemed like such an irresistable addition (compared to Java) when I first read about them, but they are practically useless. The only places you might need them is in order to create an array of structs for some obscure interop scenarios, or as an optimisation technique (but ONLY after profiling reveals abnormally high pressure on the GC).In terms of general program design, forget about them. They&#039;re just one problem after another.If they are needed for those edge-cases, fine, but maybe they should have only worked inside an &quot;unsafe&quot; block! They should have been made as unattractive as possible, to deter people from using them where a class would be fine.For example, it should have been illegal to define events in a struct. Events signal a state change, and structs ought to be immutable, hence an event on a struct should ring alarm bells.Also the inability to control how and when they are constructed makes large-scale design very difficult. Any struct can always be constructed with its contents zero-inited, and there&#039;s no way to ban that.</description> <content:encoded><![CDATA[<p>Structs seemed like such an irresistable addition (compared to Java) when I first read about them, but they are practically useless. The only places you might need them is in order to create an array of structs for some obscure interop scenarios, or as an optimisation technique (but ONLY after profiling reveals abnormally high pressure on the GC).</p><p>In terms of general program design, forget about them. They&#8217;re just one problem after another.</p><p>If they are needed for those edge-cases, fine, but maybe they should have only worked inside an &#8220;unsafe&#8221; block! They should have been made as unattractive as possible, to deter people from using them where a class would be fine.</p><p>For example, it should have been illegal to define events in a struct. Events signal a state change, and structs ought to be immutable, hence an event on a struct should ring alarm bells.</p><p>Also the inability to control how and when they are constructed makes large-scale design very difficult. Any struct can always be constructed with its contents zero-inited, and there&#8217;s no way to ban that.</p> ]]></content:encoded> </item> <item><title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #349</title><link>http://davybrion.com/blog/2009/05/why-are-mutable-value-types-even-possible/comment-page-1/#comment-15664</link> <dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #349</dc:creator> <pubDate>Mon, 18 May 2009 06:57:00 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1352#comment-15664</guid> <description>[...] Why Are Mutable Value Types Even Possible? - Davy Brion explores one of the confusing compiler errors which can be caused by using value types and not realising [...]</description> <content:encoded><![CDATA[<p>[...] Why Are Mutable Value Types Even Possible? &#8211; Davy Brion explores one of the confusing compiler errors which can be caused by using value types and not realising [...]</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/05/why-are-mutable-value-types-even-possible/comment-page-1/#comment-15607</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Sun, 17 May 2009 16:48:00 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1352#comment-15607</guid> <description>@Senthilwell, in that case it&#039;s not really so weird because then you have direct access to it, instead of it being passed around as so happens when using a property.but the fact that the code itself would work when using a field makes the whole thing even more likely to cause confusion</description> <content:encoded><![CDATA[<p>@Senthil</p><p>well, in that case it&#8217;s not really so weird because then you have direct access to it, instead of it being passed around as so happens when using a property.</p><p>but the fact that the code itself would work when using a field makes the whole thing even more likely to cause confusion</p> ]]></content:encoded> </item> <item><title>By: Senthil Kumar</title><link>http://davybrion.com/blog/2009/05/why-are-mutable-value-types-even-possible/comment-page-1/#comment-15605</link> <dc:creator>Senthil Kumar</dc:creator> <pubDate>Sun, 17 May 2009 16:11:03 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1352#comment-15605</guid> <description>My guess is to make initialization less painful, if the type has a bunch of fields. Although having a large number of fields in a struct is not recommeneded.That apart, try changing SomePoint to a public field (rather than a property), and the code will compile and work as expected. I&#039;ve always found that a bit weird.</description> <content:encoded><![CDATA[<p>My guess is to make initialization less painful, if the type has a bunch of fields. Although having a large number of fields in a struct is not recommeneded.</p><p>That apart, try changing SomePoint to a public field (rather than a property), and the code will compile and work as expected. I&#8217;ve always found that a bit weird.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/8 queries in 0.004 seconds using disk: basic
Object Caching 365/366 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d18sni7re4ly7f.cloudfront.net

Served from: davybrion.com @ 2012-02-08 19:16:17 -->
