<?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# Generics Annoyance</title>
	<atom:link href="http://elegantcode.com/2008/01/29/c-generics-annoyance/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=c-generics-annoyance</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Brandon Parker</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17541</link>
		<dc:creator>Brandon Parker</dc:creator>
		<pubDate>Mon, 04 Feb 2008 14:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17541</guid>
		<description>I think that FxCop only likes you to use the Collection generic, since the other generic classes won&#039;t pass the events on properly, or something like that.

But FxCop complains about a lot of stuff.</description>
		<content:encoded><![CDATA[<p>I think that FxCop only likes you to use the Collection generic, since the other generic classes won&#8217;t pass the events on properly, or something like that.</p>
<p>But FxCop complains about a lot of stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; Daily Bits - January 31, 2008 Alvin Ashcraft&#8217;s Daily Geek Bits: Daily links, development, gadgets and raising rugrats.</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17441</link>
		<dc:creator>&#187; Daily Bits - January 31, 2008 Alvin Ashcraft&#8217;s Daily Geek Bits: Daily links, development, gadgets and raising rugrats.</dc:creator>
		<pubDate>Thu, 31 Jan 2008 13:30:29 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17441</guid>
		<description>[...] C# Generics Annoyance (Chris Brandsma) [...]</description>
		<content:encoded><![CDATA[<p>[...] C# Generics Annoyance (Chris Brandsma) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Brandsma</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17421</link>
		<dc:creator>Chris Brandsma</dc:creator>
		<pubDate>Wed, 30 Jan 2008 16:40:25 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17421</guid>
		<description>Hi Bill,
1. I read that article of yours:
http://blechie.com/WPierce/archive/2008/01/04/Extension-Methods-are-the-Devil.aspx
But I still think extension methods are an elegant way to extend 3rd party apis (like the entire .Net framework) to better suite your needs.  The other option is that I could create a custom DropDownList that inherits from DropDownList for the sole purpose of adding the method to it.  The extension method is far simpler to implement.

2. I agree it could have been more terse.  But I don&#039;t always think terse is good.  I will take readability over terse any days.  But NameValueCollection is very old school (and only accepts strings -- which I&#039;m against), a better option would be the Dictionary object which is more type safe.  The downside of the Dictionary object is that the list is indexed by the key, and that isn&#039;t what I always want.

3. I left .Net 1.1 a while back, I don&#039;t even have Visual Studio 2003 installed anymore.  Also, I know that FxCop doesn&#039;t think generics should be in a public api.   This is a case where I will just disagree with FxCop -- especially since my api&#039;s sole purpose in life is to feed data to a web site.  It isn&#039;t a very broad range for an api.  If I was designing an api for something like SubSonic, I would reconsider that argument, but I still don&#039;t think I would taylor my api to .Net 1.1 anymore.

But, if you have another solution, by all means let me see it.  Please.  My email is chris.brandsma@gmail.com</description>
		<content:encoded><![CDATA[<p>Hi Bill,<br />
1. I read that article of yours:<br />
<a href="http://blechie.com/WPierce/archive/2008/01/04/Extension-Methods-are-the-Devil.aspx" rel="nofollow">http://blechie.com/WPierce/archive/2008/01/04/Extension-Methods-are-the-Devil.aspx</a><br />
But I still think extension methods are an elegant way to extend 3rd party apis (like the entire .Net framework) to better suite your needs.  The other option is that I could create a custom DropDownList that inherits from DropDownList for the sole purpose of adding the method to it.  The extension method is far simpler to implement.</p>
<p>2. I agree it could have been more terse.  But I don&#8217;t always think terse is good.  I will take readability over terse any days.  But NameValueCollection is very old school (and only accepts strings &#8212; which I&#8217;m against), a better option would be the Dictionary object which is more type safe.  The downside of the Dictionary object is that the list is indexed by the key, and that isn&#8217;t what I always want.</p>
<p>3. I left .Net 1.1 a while back, I don&#8217;t even have Visual Studio 2003 installed anymore.  Also, I know that FxCop doesn&#8217;t think generics should be in a public api.   This is a case where I will just disagree with FxCop &#8212; especially since my api&#8217;s sole purpose in life is to feed data to a web site.  It isn&#8217;t a very broad range for an api.  If I was designing an api for something like SubSonic, I would reconsider that argument, but I still don&#8217;t think I would taylor my api to .Net 1.1 anymore.</p>
<p>But, if you have another solution, by all means let me see it.  Please.  My email is <a href="mailto:chris.brandsma@gmail.com">chris.brandsma@gmail.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Brandsma</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17420</link>
		<dc:creator>Chris Brandsma</dc:creator>
		<pubDate>Wed, 30 Jan 2008 16:13:33 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17420</guid>
		<description>Steve: collection initializers are very nice, and I didn&#039;t completely forget about them.   If you include the Collection initializers with object initializers you could actually remove the constructors from the NameValue object all together.  And I thought of doing just that.  I decided against it when I saw all the extra code you would have to write to make it work.

But I will probably have to modify the post to show collection initializers now.</description>
		<content:encoded><![CDATA[<p>Steve: collection initializers are very nice, and I didn&#8217;t completely forget about them.   If you include the Collection initializers with object initializers you could actually remove the constructors from the NameValue object all together.  And I thought of doing just that.  I decided against it when I saw all the extra code you would have to write to make it work.</p>
<p>But I will probably have to modify the post to show collection initializers now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Pierce</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17419</link>
		<dc:creator>Bill Pierce</dc:creator>
		<pubDate>Wed, 30 Jan 2008 15:30:36 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17419</guid>
		<description>Hey Chris,
First off, Extension Methods are the Devil, so don&#039;t envy those 3.5 mofos too much.

Second, your code would be much more terse if you used a NameValueCollection rather than List&lt;NameValue&gt;. 

Ah but you say its IEnumerable implementation is flawed.  Quite true, but you could write a simple implementation in less than 100 lines of code.  Or you could ask to see my implementation.  Plus this will work for those stone age development environments like .Net 1.1.  

-Bill</description>
		<content:encoded><![CDATA[<p>Hey Chris,<br />
First off, Extension Methods are the Devil, so don&#8217;t envy those 3.5 mofos too much.</p>
<p>Second, your code would be much more terse if you used a NameValueCollection rather than List&lt;NameValue&gt;. </p>
<p>Ah but you say its IEnumerable implementation is flawed.  Quite true, but you could write a simple implementation in less than 100 lines of code.  Or you could ask to see my implementation.  Plus this will work for those stone age development environments like .Net 1.1.  </p>
<p>-Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17409</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 30 Jan 2008 08:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17409</guid>
		<description>That should have been List&lt;string&gt;</description>
		<content:encoded><![CDATA[<p>That should have been List&lt;string&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://elegantcode.com/2008/01/29/c-generics-annoyance/comment-page-1/#comment-17408</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 30 Jan 2008 08:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/01/29/c-generics-annoyance/#comment-17408</guid>
		<description>Don&#039;t forget to use the Collection Initializers for C# 3.0:
var list = new List { &quot;String1&quot;, &quot;String2&quot;, &quot;String3&quot; };</description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget to use the Collection Initializers for C# 3.0:<br />
var list = new List { &#8220;String1&#8243;, &#8220;String2&#8243;, &#8220;String3&#8243; };</p>
]]></content:encoded>
	</item>
</channel>
</rss>

