﻿<?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: Anonymous Types in C# 3.0</title>
	<atom:link href="http://www.peteonsoftware.com/index.php/2008/03/27/anonymous-types-in-c-30/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peteonsoftware.com/index.php/2008/03/27/anonymous-types-in-c-30/</link>
	<description></description>
	<lastBuildDate>Tue, 16 Aug 2011 14:45:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Brick</title>
		<link>http://www.peteonsoftware.com/index.php/2008/03/27/anonymous-types-in-c-30/comment-page-1/#comment-63</link>
		<dc:creator>Brick</dc:creator>
		<pubDate>Wed, 02 Apr 2008 03:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.peteonsoftware.com/?p=16#comment-63</guid>
		<description>Ah yes, I see. Admittedly my knowledge of LINQ is nearly non-existent but I get the concept. This does make sense, though. Just when I thought I was making some progress on getting this C# stuff under my belt they go and create all this newfangled stuff in 3.0 and 3.5! Back in my day we had pointers, manual memory allocation, and raw speed baby. You were lucky to get OOP. Seriously though thanks for the response :P If you&#039;ll excuse me I&#039;ve got to go pay for groceries with nickels, chase kids off my lawn, and complain about my pension.</description>
		<content:encoded><![CDATA[<p>Ah yes, I see. Admittedly my knowledge of LINQ is nearly non-existent but I get the concept. This does make sense, though. Just when I thought I was making some progress on getting this C# stuff under my belt they go and create all this newfangled stuff in 3.0 and 3.5! Back in my day we had pointers, manual memory allocation, and raw speed baby. You were lucky to get OOP. Seriously though thanks for the response <img src='http://www.peteonsoftware.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  If you&#8217;ll excuse me I&#8217;ve got to go pay for groceries with nickels, chase kids off my lawn, and complain about my pension.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://www.peteonsoftware.com/index.php/2008/03/27/anonymous-types-in-c-30/comment-page-1/#comment-61</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Tue, 01 Apr 2008 14:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.peteonsoftware.com/?p=16#comment-61</guid>
		<description>Brick!!!!

Great to hear from you.  &lt;a href=&quot;http://weblogs.asp.net/leftslipper/archive/2007/09/24/using-c-3-0-anonymous-types-as-dictionaries.aspx&quot; rel=&quot;nofollow&quot;&gt;This link&lt;/a&gt; has a good use for anonymous types.  Additionally, anonymous types are good for use in LINQ.  &lt;a href=&quot;http://www.davidhayden.com/blog/dave/archive/2006/12/06/AnonymousTypesCSharp.aspx&quot; rel=&quot;nofollow&quot;&gt;This link&lt;/a&gt; talks a little about that.

As for structs, if all you are doing is looking to store some data in the same way repeatedly, structs are still a legitimate way to go.  Anonymous types shouldn&#039;t battle too far into the struct space.

Anonymous types are strong for the things I outlined above, and also for use in testing or creating lightweight mocks.  Let&#039;s pretend you are waiting on another group to create an object for you and to populate it.  But you have to test what you are doing.  You could define the object somewhere in your code temporarily and then consume its properties, or you could define an anonymous type with the same variable name (one line of code), and then call it in your code exactly the same way that you will call the real objects properties when it is finished.  I know that B-Mad used it in this way at his last job.</description>
		<content:encoded><![CDATA[<p>Brick!!!!</p>
<p>Great to hear from you.  <a href="http://weblogs.asp.net/leftslipper/archive/2007/09/24/using-c-3-0-anonymous-types-as-dictionaries.aspx" rel="nofollow">This link</a> has a good use for anonymous types.  Additionally, anonymous types are good for use in LINQ.  <a href="http://www.davidhayden.com/blog/dave/archive/2006/12/06/AnonymousTypesCSharp.aspx" rel="nofollow">This link</a> talks a little about that.</p>
<p>As for structs, if all you are doing is looking to store some data in the same way repeatedly, structs are still a legitimate way to go.  Anonymous types shouldn&#8217;t battle too far into the struct space.</p>
<p>Anonymous types are strong for the things I outlined above, and also for use in testing or creating lightweight mocks.  Let&#8217;s pretend you are waiting on another group to create an object for you and to populate it.  But you have to test what you are doing.  You could define the object somewhere in your code temporarily and then consume its properties, or you could define an anonymous type with the same variable name (one line of code), and then call it in your code exactly the same way that you will call the real objects properties when it is finished.  I know that B-Mad used it in this way at his last job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brick</title>
		<link>http://www.peteonsoftware.com/index.php/2008/03/27/anonymous-types-in-c-30/comment-page-1/#comment-58</link>
		<dc:creator>Brick</dc:creator>
		<pubDate>Mon, 31 Mar 2008 21:33:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.peteonsoftware.com/?p=16#comment-58</guid>
		<description>I&#039;m leaving this comment to serve a couple purposes:

1. See! I actually do read your site :P
2. To demonstrate my noobness
3. I have a legitimate question. What&#039;s a scenario where you would use an anonymous type over a structure? They seem very similiar and structures are value types and so are placed on the stack (faster right?).</description>
		<content:encoded><![CDATA[<p>I&#8217;m leaving this comment to serve a couple purposes:</p>
<p>1. See! I actually do read your site <img src='http://www.peteonsoftware.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
2. To demonstrate my noobness<br />
3. I have a legitimate question. What&#8217;s a scenario where you would use an anonymous type over a structure? They seem very similiar and structures are value types and so are placed on the stack (faster right?).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

