<?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: Do Not Return Private C# Arrays</title>
	<atom:link href="http://www.csharp411.com/do-not-return-private-c-arrays/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/do-not-return-private-c-arrays/</link>
	<description>C# Development</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:14:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Steve</title>
		<link>http://www.csharp411.com/do-not-return-private-c-arrays/#comment-701</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 16 Jun 2008 09:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/do-not-return-private-c-arrays/#comment-701</guid>
		<description>System.Collections.ObjectModel.ReadOnlyCollection(Of T) is the class for this purpose.  Has array-like semantics (including random access by this[int index]).

Don&#039;t leave home without it :)</description>
		<content:encoded><![CDATA[<p>System.Collections.ObjectModel.ReadOnlyCollection(Of T) is the class for this purpose.  Has array-like semantics (including random access by this[int index]).</p>
<p>Don&#8217;t leave home without it <img src='http://www.csharp411.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShaharY</title>
		<link>http://www.csharp411.com/do-not-return-private-c-arrays/#comment-700</link>
		<dc:creator>ShaharY</dc:creator>
		<pubDate>Wed, 11 Jun 2008 17:22:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/do-not-return-private-c-arrays/#comment-700</guid>
		<description>I like that but deep clone can be expensive.
You can also use List which has a AsReadOnly() method, both methods enforces readonly on runtime.
You can also expose your collection as IEnumerable and enforce readonly at compiletime (although I don&#039;t like dealing with IEnumerable, it has a very poor API). You can read more about those issues here: http://www.dev102.com/2008/04/10/how-to-expose-your-collections-safely/</description>
		<content:encoded><![CDATA[<p>I like that but deep clone can be expensive.<br />
You can also use List which has a AsReadOnly() method, both methods enforces readonly on runtime.<br />
You can also expose your collection as IEnumerable and enforce readonly at compiletime (although I don&#8217;t like dealing with IEnumerable, it has a very poor API). You can read more about those issues here: <a href="http://www.dev102.com/2008/04/10/how-to-expose-your-collections-safely/" rel="nofollow">http://www.dev102.com/2008/04/10/how-to-expose-your-collections-safely/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

