<?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: Refactoring C# Series: Use Automatic Property</title>
	<atom:link href="http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Sep 2011 17:23:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: dm</title>
		<link>http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/comment-page-1/#comment-22</link>
		<dc:creator>dm</dc:creator>
		<pubDate>Thu, 02 Apr 2009 23:50:17 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2007/12/28/refactoring-c-sharp-series-use-automatic-property/#comment-22</guid>
		<description>john, dave: if you need guarantees like that then use regular properties.
auto properties are only there to save you time if they can save you time.  no one is making you use them.  in about 75% of cases in my code, i can get away with auto properties.  the places where they don&#039;t work--it&#039;s not a big deal. seriously.</description>
		<content:encoded><![CDATA[<p>john, dave: if you need guarantees like that then use regular properties.<br />
auto properties are only there to save you time if they can save you time.  no one is making you use them.  in about 75% of cases in my code, i can get away with auto properties.  the places where they don&#8217;t work&#8211;it&#8217;s not a big deal. seriously.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/comment-page-1/#comment-21</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Tue, 11 Nov 2008 17:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2007/12/28/refactoring-c-sharp-series-use-automatic-property/#comment-21</guid>
		<description>The problem isn&#039;t that the automatic properties are initialized to null.  That can be taken care of in the constructor.  The problem is that there is no way to enforce that the setters cannot be called with null.  There needs to be an annotation or a keyword to indicate that null is not an acceptable value and should generate an exception.</description>
		<content:encoded><![CDATA[<p>The problem isn&#8217;t that the automatic properties are initialized to null.  That can be taken care of in the constructor.  The problem is that there is no way to enforce that the setters cannot be called with null.  There needs to be an annotation or a keyword to indicate that null is not an acceptable value and should generate an exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Bushnell</title>
		<link>http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/comment-page-1/#comment-20</link>
		<dc:creator>Richard Bushnell</dc:creator>
		<pubDate>Mon, 18 Aug 2008 07:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2007/12/28/refactoring-c-sharp-series-use-automatic-property/#comment-20</guid>
		<description>Hi John,

I just set the initial value of the properties in my constructor. I&#039;ve got used to doing this now, and find that it makes the initial values of my properties much easier to find when coming to read the code later.

Using the code snippets for properties in Visual Studio (&quot;prop&quot; and &quot;propg&quot;), I can write my properties really fast, with really compact code. Then I pop up to my constructor(s) and set the initial values of the properties there.

HTH.

Richard</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I just set the initial value of the properties in my constructor. I&#8217;ve got used to doing this now, and find that it makes the initial values of my properties much easier to find when coming to read the code later.</p>
<p>Using the code snippets for properties in Visual Studio (&#8220;prop&#8221; and &#8220;propg&#8221;), I can write my properties really fast, with really compact code. Then I pop up to my constructor(s) and set the initial values of the properties there.</p>
<p>HTH.</p>
<p>Richard</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laughing John</title>
		<link>http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/comment-page-1/#comment-19</link>
		<dc:creator>Laughing John</dc:creator>
		<pubDate>Fri, 15 Aug 2008 14:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2007/12/28/refactoring-c-sharp-series-use-automatic-property/#comment-19</guid>
		<description>This is NOT a good feature.

It is made useless because you cannot initialize the properties. Strings and objects will always default to null which is often not the required behaviour.

Additionally you can no longer use the prop snippet to generate a standard property.

So these are often only of use for a reference type and it now takes longer to create a standard property. Where&#039;s the sense in that?

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361647</description>
		<content:encoded><![CDATA[<p>This is NOT a good feature.</p>
<p>It is made useless because you cannot initialize the properties. Strings and objects will always default to null which is often not the required behaviour.</p>
<p>Additionally you can no longer use the prop snippet to generate a standard property.</p>
<p>So these are often only of use for a reference type and it now takes longer to create a standard property. Where&#8217;s the sense in that?</p>
<p><a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361647" rel="nofollow">http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361647</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamed Abdeen</title>
		<link>http://www.richardbushnell.net/2007/12/28/refactoring-c-sharp-series-use-automatic-property/comment-page-1/#comment-18</link>
		<dc:creator>Mohamed Abdeen</dc:creator>
		<pubDate>Tue, 26 Feb 2008 08:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://richardbushnell.net/index.php/2007/12/28/refactoring-c-sharp-series-use-automatic-property/#comment-18</guid>
		<description>That&#039;s a good feature</description>
		<content:encoded><![CDATA[<p>That&#8217;s a good feature</p>
]]></content:encoded>
	</item>
</channel>
</rss>

