Questioning the namespace design
All code is placed into NaturalSort.Extension. However, only NaturalSortExtension are "Extension" methods. Shouldn't the code better be structured as follows?
namespace NaturalSort class NaturalSortComparer
namespace NaturalSort.Extension class NaturalSortExtension or NaturalSortExtensionMethods
Rationale of this proposal:
- With the current design, all being placed in a single namespace, a
using NaturalSort.Extension;will always make bothComparerandExtensionvisible. - WIth the proposed design, the user can selectively make
Comparerand/orExtensionvisible, same as e.g. theSystem.LINQnamespace that makes extension methods for e.g.System.Collectionsvisible.
Yes, I guess that would make more sense.
But then again NaturalSort.Extension is the name of the NuGet package (which I guess is also not 100% perfect). This way it's the same namespace as the NuGet package name, so at least it's somehow aligned here.
I'm afraid to change the NuGet package name now that it has 1.5M downloads...
Maybe we can think about the "extension" meaning not just an extension method, but an extension to the BCL.
Like how all the Microsoft.Extensions.* packages aren't just extension methods.
I see. Didn't know about the Microsoft.Extensions. Just noticed that all other "extension" libraries I use aren't named like that.
Maybe the idea behind can be commented in code. I fully understand you don't want to change something that basic anymore.