<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx</link><description>There is a good debate going on over in the Whidbey product feedback site . I encourage you to go and chime in one way or another&amp;#8230; The team is watching the thread there and looking for feedback. On the surface this looks like a simple issue (more</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#191234</link><pubDate>Thu, 22 Jul 2004 15:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:191234</guid><dc:creator>陈奕迅</dc:creator><description>why?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=191234" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#180121</link><pubDate>Sun, 11 Jul 2004 18:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:180121</guid><dc:creator>Ming Chen(VSData)</dc:creator><description>I think I am becomming a lazy person since I get hooked on the intellisense.  I typically rely intellisense pop up the class method to look for the method and parameters instead of look it up from the menu/help (I really hate MSDN unless I have to).  Hey I am not the only one---&lt;br&gt;&lt;a target="_new" href="http://www.joelonsoftware.com/uibook/chapters/fog0000000062.htmlIf"&gt;http://www.joelonsoftware.com/uibook/chapters/fog0000000062.htmlIf&lt;/a&gt;&lt;br&gt;&lt;br&gt;From that perspective, well, I learn my lesson of put the *long &amp;amp; descriptive* name in the type defination, xml comment on the beginning every public function that will benefit other teammate whoever to use it and vise versa.&lt;br&gt;&lt;br&gt;That is, if I have to choose to purchase a external templateize colletion from two companies one implement Dictionary&amp;lt;Key,Value&amp;gt;, the other implements Dictionary&amp;lt;K, V&amp;gt;, I will pick Dictionary&amp;lt;Key,Value&amp;gt; anyday.&lt;br&gt;&lt;br&gt;Yes, i am VS intelliense addict &amp;amp; I don't *want to* read manual unless absolute necessary. &lt;br&gt;&lt;br&gt;-Ming&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=180121" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#179826</link><pubDate>Sun, 11 Jul 2004 06:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179826</guid><dc:creator>Keith Patrick</dc:creator><description>Key/Value (or whatever the class is supposed to be).  It's like getting rid of Hungarian notation: let the IDE tell you what something is to the compiler/runtime, not the name, so why use abbreviations to denote a template/generic?  Also, the concept doesn't really extend out beyond traditional templates.  Sure, there's K/V, and it's well understood, but what woudl the standard be (and for that matter, the litmus) for when something is well-known enough to abbreviate?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=179826" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#179797</link><pubDate>Sun, 11 Jul 2004 05:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179797</guid><dc:creator>Cyrus Najmabadi</dc:creator><description>I've flipped my position on this after a conversation with SteveJS. I'll post something on it later :-)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=179797" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#179561</link><pubDate>Sat, 10 Jul 2004 19:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:179561</guid><dc:creator>Klaus</dc:creator><description>Spell the type parameters out, please. So my vote is for the Dictionary&amp;lt;KeyType, ValueType&amp;gt;. I would read the use of &amp;lt;&amp;gt; and from that know that it should not be used as Dictionary&amp;lt;2,26&amp;gt;.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=179561" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#175684</link><pubDate>Wed, 07 Jul 2004 20:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:175684</guid><dc:creator>damien morton</dc:creator><description>Philip - your example has me recoiling - youre right - its ugly and distracting.&lt;br&gt;&lt;br&gt;How about this then:&lt;br&gt;&lt;br&gt;@Value Process(@Other key)&lt;br&gt;{&lt;br&gt;  @Other newKey = key.Next();&lt;br&gt;  foreach (@Value value in values[key])&lt;br&gt;  {&lt;br&gt;     value = key.Get&amp;lt;@Value&amp;gt;&lt;br&gt;  }&lt;br&gt;...&lt;br&gt;&lt;br&gt;Perhaps this distinguishes type paramaters, without beeing to visually jarring. (shades of perl, but... type paramaters are special and you dont want to go an confuse them with actual types).&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=175684" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#175623</link><pubDate>Wed, 07 Jul 2004 19:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:175623</guid><dc:creator>Philip Rieck</dc:creator><description>Damien - the only problem with VALUE is that many other languages (C# included, to some extent), use the all caps pattern to signify a constant, #define, or macro -- In fact, it's normally reserved for a value fixed at compile time.     &lt;br&gt;&lt;br&gt;Also, I personally would be distracted by code such as this (completely nonsensical:)&lt;br&gt;VALUE Process(OTHER key)&lt;br&gt;{&lt;br&gt;   OTHER newKey = key.Next();&lt;br&gt;   foreach(VALUE value in values[key])&lt;br&gt;  {&lt;br&gt;  value = key.Get&amp;lt;VALUE&amp;gt;&lt;br&gt;...&lt;br&gt;&lt;br&gt;&lt;br&gt;-- you can see that the all-caps type specifiers can be littered in there quite a bit, and would distract a reader.  The reader would be much more likely to care what the code does than to have the placement of type specifiers scream out at them&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=175623" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#175548</link><pubDate>Wed, 07 Jul 2004 18:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:175548</guid><dc:creator>damien morton</dc:creator><description>Cyrus sais:&lt;br&gt;public interface IDictionary&amp;lt;KeyType,ValueType&amp;gt;&lt;br&gt;{&lt;br&gt;ValueType GetAt(KeyType key);&lt;br&gt;}&lt;br&gt;&lt;br&gt;Why is KeyType necessary? We know it's a &amp;quot;key&amp;quot; because the name of the variable is &amp;quot;key&amp;quot;. &lt;br&gt;&lt;br&gt;Damien sais:&lt;br&gt;&lt;br&gt;Ahh - but what about ValueType in that expression - we dont know what that is, until we look at the name of the generic type param.&lt;br&gt;&lt;br&gt;how about this pattern:&lt;br&gt;&lt;br&gt;public interface IDictionary&amp;lt;KEY,VALUE&amp;gt;&lt;br&gt;{&lt;br&gt;VALUE GetAt(KEY key);&lt;br&gt;}&lt;br&gt;&lt;br&gt;I know evyerone will recoil at the use of all-caps, but its shorter and clearer than pre-pending a letter  or appending the word &amp;quot;Type&amp;quot;. Its a currently unused pattern, and its compatable with single-upper-case-letters for simple type params.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=175548" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#175074</link><pubDate>Wed, 07 Jul 2004 08:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:175074</guid><dc:creator>Cyrus Najmabadi</dc:creator><description>I'm looking forward to prepending classes with C, delegates with D, and enums with E.   There's a certain beauty in the succession of those letts, C/D/E.  Now we just need to something to start with F...&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=175074" width="1" height="1"&gt;</description></item><item><title>re: Naming generic type parameters: Dictionary&lt;K,V&gt; or Dictionary&lt;KeyType, ValueType&gt;</title><link>http://blogs.msdn.com/b/brada/archive/2004/07/04/172982.aspx#175072</link><pubDate>Wed, 07 Jul 2004 08:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:175072</guid><dc:creator>Cyrus Najmabadi</dc:creator><description>Julien: Dont' get me started on how much I hate that about interfaces :-)&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=175072" width="1" height="1"&gt;</description></item></channel></rss>