title: what's the benefits to split a single namespace across multiple C# files?
body: <p>I'm reading a book which shows an example below:</p>
  <blockquote>
  <p>Assume you are developing a collection of geometric classes named Square,
  Circle, and Hexagon. Given their similarities, you would like to group them together into a unique namespace called MyShapes within the CustomNamespaces.exe assembly. You have two basic approaches. First, you can choose to define all classes in a single C# file (ShapesLib.cs) as follows:</p>
  </blockquote>
  <pre><code>// ShapesLib.cs
  using System;
  
  namespace MyShapes
  {
      public class Circle { /* Interesting members... */ }
  
      public class Hexagon { /* More interesting members... */ }
  
      public class Square { /* Even more interesting members... */ }
  }
  </code></pre>
  <blockquote>
  <p>While the C# compiler has no problems with a single C# code file containing multiple types, this could be cumbersome when you want to reuse class definitions in new projects. For example, say you are building a new project and only need to use the Circle class. If all types are defined in a single code file, you are more or less stuck with the entire set. Therefore, as an alternative, you can split a single namespace across multiple C# files.</p>
  </blockquote>
  <pre><code>// Circle.cs
  using System;
  namespace MyShapes
  {
      public class Circle { /* Interesting methods... */ }
  }
  
  // Hexagon.cs
  using System;
  namespace MyShapes
  {
      public class Hexagon { /* More interesting methods... */ }
  }
  
  // Square.cs
  using System;
  namespace MyShapes
  {
      public class Square { /* Even more interesting methods... */ }
  }
  </code></pre>
  <p>I don't quite understand it, what does <em>reuse class definitions in new projects</em> mean? In both case, when you want to use <code>Circle</code> class in other projects, you need to use <code>MyShapes.Circle c = new Circle()</code> explicitly or use <code>using MyShapes; Circle c = new Circle();</code>, so there is really no difference between &quot;define all classes in a single C# file' or &quot;split a single namespace across multiple C# files&quot;?</p>