<?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: C# 3.0 Tutorials: Auto-Implemented Properties (a.k.a Automatic Properties)</title>
	<atom:link href="http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties</link>
	<description>Sharing our knowledge</description>
	<lastBuildDate>Thu, 04 Mar 2010 13:05:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: .NET Auto-Property &#124; StupidProgrammer.com</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-157906</link>
		<dc:creator>.NET Auto-Property &#124; StupidProgrammer.com</dc:creator>
		<pubDate>Thu, 26 Mar 2009 18:23:49 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-157906</guid>
		<description>[...] can read a little more over at Michael Sync’s blog.    &#171; User Already Exists in the Current [...]</description>
		<content:encoded><![CDATA[<p>[...] can read a little more over at Michael Sync’s blog.    &laquo; User Already Exists in the Current [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oggy</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-140842</link>
		<dc:creator>Oggy</dc:creator>
		<pubDate>Sat, 07 Feb 2009 08:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-140842</guid>
		<description>Almost up to now I believed that Microsoft did something clever, that, anyway, it could have done much earlier but unfortunately I was wrong. Setting up an auto-implemented property like:

class A
{
   public int myInt {get; set;}
}

is completely rediculus and useless. Absolutely the same functionality is achieved by setting a variable like:
  
public int myInt;

Can anyone tell the difference?!?
...maybe there are some achivements if we are going to inherit the class

What is really new is setting one of either GET or SET to private, but that&#039;s not completely logic of a property.

I thought they had made, and something that would be meaningfull is:

public int myInt
{   get;
    set { myInt=value;
          //some other stuff caused by changing the value
        }
}

or

public int myInt
{   get
    { //some calculation
      return result;
    set;
}

So in this way you would be able to write only the part of the code that is different from &quot;default codes&quot; for get and set....
....I am really pissed off!</description>
		<content:encoded><![CDATA[<p>Almost up to now I believed that Microsoft did something clever, that, anyway, it could have done much earlier but unfortunately I was wrong. Setting up an auto-implemented property like:</p>
<p>class A<br />
{<br />
   public int myInt {get; set;}<br />
}</p>
<p>is completely rediculus and useless. Absolutely the same functionality is achieved by setting a variable like:</p>
<p>public int myInt;</p>
<p>Can anyone tell the difference?!?<br />
&#8230;maybe there are some achivements if we are going to inherit the class</p>
<p>What is really new is setting one of either GET or SET to private, but that&#8217;s not completely logic of a property.</p>
<p>I thought they had made, and something that would be meaningfull is:</p>
<p>public int myInt<br />
{   get;<br />
    set { myInt=value;<br />
          //some other stuff caused by changing the value<br />
        }<br />
}</p>
<p>or</p>
<p>public int myInt<br />
{   get<br />
    { //some calculation<br />
      return result;<br />
    set;<br />
}</p>
<p>So in this way you would be able to write only the part of the code that is different from &#8220;default codes&#8221; for get and set&#8230;.<br />
&#8230;.I am really pissed off!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Rausch</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-96983</link>
		<dc:creator>Jeff Rausch</dc:creator>
		<pubDate>Wed, 27 Aug 2008 18:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-96983</guid>
		<description>What are your thoughts on initializing properties in the constructor?  I have been searching for info on what the CLR initialzes different types to (eg. for type &#039;string&#039; is it null or string.empty) and have not been able to find much information on it.  If you know of any sites or where on MSDN that it&#039;s explained it would be helpful.  
I have found a few sites that say to just let the CLR initialize values (unless a special value is needed of course) but I would really like to know what value things will be initialized to if I don&#039;t specify one.</description>
		<content:encoded><![CDATA[<p>What are your thoughts on initializing properties in the constructor?  I have been searching for info on what the CLR initialzes different types to (eg. for type &#8217;string&#8217; is it null or string.empty) and have not been able to find much information on it.  If you know of any sites or where on MSDN that it&#8217;s explained it would be helpful.<br />
I have found a few sites that say to just let the CLR initialize values (unless a special value is needed of course) but I would really like to know what value things will be initialized to if I don&#8217;t specify one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Nelson</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-92269</link>
		<dc:creator>David Nelson</dc:creator>
		<pubDate>Tue, 12 Aug 2008 18:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-92269</guid>
		<description>The main reason to expose something as a property instead of a field is so that is you discover later on that you need to add logic around that field, you can do so without making a binary breaking change. This has always been the official guidance, but many people still used fields because they felt like properties were too verbose. Automatic properties were added to make it easier to do the right thing.</description>
		<content:encoded><![CDATA[<p>The main reason to expose something as a property instead of a field is so that is you discover later on that you need to add logic around that field, you can do so without making a binary breaking change. This has always been the official guidance, but many people still used fields because they felt like properties were too verbose. Automatic properties were added to make it easier to do the right thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-70427</link>
		<dc:creator>Victor</dc:creator>
		<pubDate>Tue, 10 Jun 2008 11:14:13 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-70427</guid>
		<description>Another benefit I found was in debugging. In the traditional way of defining property when you F10 that statement, the debugger goes into the property. This is rather annoying when you know it&#039;s a one-liner.

With auto-property the debugger skips the internal and goes to inspect the next statement. Pretty darn convenient.</description>
		<content:encoded><![CDATA[<p>Another benefit I found was in debugging. In the traditional way of defining property when you F10 that statement, the debugger goes into the property. This is rather annoying when you know it&#8217;s a one-liner.</p>
<p>With auto-property the debugger skips the internal and goes to inspect the next statement. Pretty darn convenient.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NiamorH</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-67243</link>
		<dc:creator>NiamorH</dc:creator>
		<pubDate>Sat, 31 May 2008 08:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-67243</guid>
		<description>Pete
it can be useful when you have a read only property that is not likely to change during the objet lifetime / that is not likely to throw event notifications.

Then typing :

public int YearBorn { get; private set; }

can be nice.

I agree that this is not the common scheme.</description>
		<content:encoded><![CDATA[<p>Pete<br />
it can be useful when you have a read only property that is not likely to change during the objet lifetime / that is not likely to throw event notifications.</p>
<p>Then typing :</p>
<p>public int YearBorn { get; private set; }</p>
<p>can be nice.</p>
<p>I agree that this is not the common scheme.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-43738</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 04 Mar 2008 22:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-43738</guid>
		<description>Michael

Automatic properties are useful, but there are drawbacks to getting into the mindset of using this. Consider that you have an automatic property - what benefit are you actually getting? How is this an improvement on just exposing a field?

You would normally want to use a property to do more than just control access to the field - so you might put some code into the property setter to notify you that the property has changed. This means that you are going to have to forgo the automatic property and actually handle it yourself.</description>
		<content:encoded><![CDATA[<p>Michael</p>
<p>Automatic properties are useful, but there are drawbacks to getting into the mindset of using this. Consider that you have an automatic property &#8211; what benefit are you actually getting? How is this an improvement on just exposing a field?</p>
<p>You would normally want to use a property to do more than just control access to the field &#8211; so you might put some code into the property setter to notify you that the property has changed. This means that you are going to have to forgo the automatic property and actually handle it yourself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: W&#246;chentliche Rundablage: ASP.NET MVC, ASP.NET, Windows Live, Silverlight 2, LINQ, C# 3.0, CardSpace&#8230; &#124; Code-Inside Blog</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-43548</link>
		<dc:creator>W&#246;chentliche Rundablage: ASP.NET MVC, ASP.NET, Windows Live, Silverlight 2, LINQ, C# 3.0, CardSpace&#8230; &#124; Code-Inside Blog</dc:creator>
		<pubDate>Mon, 03 Mar 2008 19:21:24 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-43548</guid>
		<description>[...] C# 3.0 Tutorials: Auto-Implemented Properties (a.k.a Automatic Properties) [...]</description>
		<content:encoded><![CDATA[<p>[...] C# 3.0 Tutorials: Auto-Implemented Properties (a.k.a Automatic Properties) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-42984</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Sat, 01 Mar 2008 05:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-42984</guid>
		<description>hey buddy. I have changed the sentence.. thanks for that..</description>
		<content:encoded><![CDATA[<p>hey buddy. I have changed the sentence.. thanks for that..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties/comment-page-1#comment-42973</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Sat, 01 Mar 2008 03:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/02/29/c-30-tutorials-auto-implemented-properties-aka-automatic-properties#comment-42973</guid>
		<description>oh.. yes.. i see thanks.  but what I was trying to say is that both &quot;“Encapsulate Field” from “Refactor”&quot; and &quot;prop&quot; with two tabs&quot; can used with C# in VS 20005. If you are using VB.NET, those feature are not available in VS 2005.</description>
		<content:encoded><![CDATA[<p>oh.. yes.. i see thanks.  but what I was trying to say is that both &#8220;“Encapsulate Field” from “Refactor”&#8221; and &#8220;prop&#8221; with two tabs&#8221; can used with C# in VS 20005. If you are using VB.NET, those feature are not available in VS 2005.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
