<?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>Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx</link><description>(This is part four of a four part series; part three is here .) Part Four: Making the problem worse I said earlier that the fundamental reason for namespaces in the first place was organization of types into a hierarchy, not separation of two things with</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#10297298</link><pubDate>Tue, 24 Apr 2012 18:57:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10297298</guid><dc:creator>Stephen</dc:creator><description>&lt;p&gt;This does make it hard when you want namespaces like this:&lt;/p&gt;
&lt;p&gt;Doctor.Events, Doctor.Services, Doctor.BusinessObjects&lt;/p&gt;
&lt;p&gt;And then in Doctor.BusinessObjects you want a class called Doctor.&lt;/p&gt;
&lt;p&gt;Each namespace is a type of Doctor functionality, but you can&amp;#39;t call them that and still have a Doctor class.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10297298" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#10254761</link><pubDate>Mon, 09 Jan 2012 22:27:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10254761</guid><dc:creator>Newell Henry Clark</dc:creator><description>&lt;p&gt;Thanks, man. I just went and renamed my static GameEngine class to GameEngineUpdator. It was originally NewellHenryClark.GameEngine.GameEngine, but now I know better, all thanks to you :D&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10254761" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9989107</link><pubDate>Thu, 01 Apr 2010 20:02:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9989107</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;The Los Angeles Angels ought to play nothing but doubleheaders.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9989107" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9984161</link><pubDate>Wed, 24 Mar 2010 07:59:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9984161</guid><dc:creator>Julien Lebosquain</dc:creator><description>&lt;P&gt;Is there any reason why System.Configuration.Configuration doesn't follow this rule? It's always painful to use in code. System.Configuration.Config (or something similar) would have been much better, like there isn't a System.Text.Regex.Regex for instance.&lt;/P&gt;
&lt;DIV class=yellowbox&gt;
&lt;P&gt;My guess -- and I emphasize that this is a guess -- is that the class in question was invented *before* the framework design guidelines were written. -- Eric&lt;/P&gt;&lt;/DIV&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9984161" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9983044</link><pubDate>Mon, 22 Mar 2010 16:07:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9983044</guid><dc:creator>Szindbad</dc:creator><description>&lt;p&gt;John: I like this feature because the folder structure and namespaces are two independent hierarchies, but this feature is try to make them similar, which is beneficial for project &amp;quot;complexity&amp;quot;. Managing one hierarchy instead of two is huge benefit.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9983044" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9982903</link><pubDate>Mon, 22 Mar 2010 12:37:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9982903</guid><dc:creator>John</dc:creator><description>&lt;p&gt;One of the annoying (to me that is) characteristics of VSxxxx is that when you add a folder in a project, Visual Studio defaults classes in the folder to a namespace which ends with the name of the folder. &amp;nbsp;If a programmer is using the folders for physical (as opposed to namespace) organizational purposes, she/he either has to remove the folder name from the namespace of the new class or add a new using statement to include that folder. &amp;nbsp;In tools/options, the programmer should be able to limit the default namespace to the project. &amp;nbsp;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982903" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9982151</link><pubDate>Fri, 19 Mar 2010 22:18:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9982151</guid><dc:creator>Gabe</dc:creator><description>&lt;p&gt;I was just wondering what happens to a class when you declare it without a surrounding namespace{}. It appears the answer is that it goes in the implicit global namespace.&lt;/p&gt;
&lt;p&gt;The first C# app I wrote was for .Net 1.1, and I forgot to put one of my classes in a namespace declaration. Well, it just so happened that when .Net 2.0 came out, it declared a class by the same name. When somebody ran my app on a computer with .Net 2.0 installed but not 1.1, it ran in the 2.0 CLR and got the new class of the same name.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982151" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9982102</link><pubDate>Fri, 19 Mar 2010 20:37:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9982102</guid><dc:creator>Stuart</dc:creator><description>&lt;p&gt;oh no it doesn't compile, needs a &amp;quot;return&amp;quot; in there. Drat.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982102" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9982097</link><pubDate>Fri, 19 Mar 2010 20:29:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9982097</guid><dc:creator>Stuart</dc:creator><description>&lt;p&gt;namespace Buffalo {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;public class Buffalo {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Buffalo.Buffalo buffalo(Buffalo.Buffalo Buffalo) { buffalo(Buffalo); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I think that actually ought to compile, although I haven't tried it. Infinite recursion when run, however.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982097" width="1" height="1"&gt;</description></item><item><title>re: Do not name a class the same as its namespace, Part Four</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/03/18/do-not-name-a-class-the-same-as-its-namespace-part-four.aspx#9982094</link><pubDate>Fri, 19 Mar 2010 20:27:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9982094</guid><dc:creator>Stuart</dc:creator><description>&lt;p&gt;Obligatory mention of buffalo.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982094" width="1" height="1"&gt;</description></item></channel></rss>