Class.Class vs Namespace.Class for top level general use class libraries?
- by Joan Venge
Which one is more acceptable (best-practice)?:
namespace NP
public static class IO
public static class Xml
...
// extension methods
using NP;
IO.GetAvailableResources ();
vs
public static class NP
public static class IO
public static class Xml
...
// extension methods
NP.IO.GetAvailableResources ();
Also for #2, the code size is managed by having partial classes so each nested class can be in a separate file, same for extension methods (except that there is no nested class for them)
I prefer #2, for a couple of reasons like being able to use type names that are already commonly used, like IO, that I don't want to replace or collide.
Which one do you prefer? Any pros and cons for each? What's the best practice for this case?
EDIT: Also would there be a performance difference between the two?