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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…