HtmlSanitizer icon indicating copy to clipboard operation
HtmlSanitizer copied to clipboard

Rename namespace

Open vanillajonathan opened this issue 3 years ago • 4 comments

Rename namespace from Ganss.XSS to Ganss.Xss as per the Microsoft .NET Framework Design Guidelines Capitalization Conventions.

vanillajonathan avatar Jul 25 '22 13:07 vanillajonathan

@mganss You okay with this?

vanillajonathan avatar Aug 07 '22 19:08 vanillajonathan

@vanillajonathan Just my opinion, obviously, but I don't know that this is really required. .NET has namespaces that violate the stated convention already, like System.IO. XSS is an acronym, not a proper word, so I'd expect it to be written as-is.

Of course, there are namespaces like System.Web.Security.AntiXss, so perhaps the precedent has been established to use the casing you're proposing. 🤷‍♂️

tiesont avatar Aug 08 '22 00:08 tiesont

I'm hesitant on this. Not only would this be a breaking change, but it would require recompilation for all users. If I were faced with this change as a user, I'd probably think 🙄

mganss avatar Aug 08 '22 09:08 mganss

@tiesont No System.IO does not violate the .NET naming guidelines because IO is a two-letter acronym and the the naming convention does not apply to two-letter acronyms, only three letter and longer. The linked page explains this.

@mganss Yes, this would a breaking change, but so was PR #370. They're both breaking changes. Introducing these breaking changes should be since they're introduced together at the same time for version 8.

vanillajonathan avatar Aug 08 '22 10:08 vanillajonathan

I know this would be a good opportunity to introduce breaking changes. The issue I'm having with this change is that it's not about features but "just" a naming change, in particular one that might confuse users. When they update the NuGet package and recompile, they'll get errors which are not obvious to fix.

mganss avatar Aug 09 '22 09:08 mganss

Modern IDEs autodiscover referenced classes and provides suggestions for using statements. You hover over the HtmlSanatizerin the code and it presents you with a yellow light bulb that says "Import Ganss.Xss", this should be trivial for users to fix.

vanillajonathan avatar Aug 09 '22 09:08 vanillajonathan

If this is the one and only thing in the project that violates the naming convention, I suppose it's at least worth considering. Does feel like like a rather pedantic change, if I'm being honest. I say that with absolutely no malice or ill will intended.

tiesont avatar Aug 09 '22 09:08 tiesont

I am not aware of anything else that violates the naming convention. I agree that it is a pedantic change, but it would nice to "get it right" when there is an API breakage anyway in a new major version 8 release.

vanillajonathan avatar Aug 09 '22 12:08 vanillajonathan

🆗 Let's do it then.

mganss avatar Aug 11 '22 08:08 mganss