GregSmalter / TEWL

The Toolkit for the Enterprise Web Library. This can be used to conveniently gain validation, IO, and string manipulation functions without subscribing to the whole library lifecycle.
MIT License
2 stars 2 forks source link

Tewl.Tools folder should be in root namespace #9

Closed william-gross closed 4 years ago

william-gross commented 4 years ago

I think we want most of what is in there to be in intellisense as much as possible. Having "Tools" be in the root namespace follows what we did in EWL with the Tools folder.

GregSmalter commented 4 years ago

I'm not going to do this for two reasons. The first is that since EWF was made, tools have changed a lot. And now, even if you don't have a namespace imported, tools (such as R#) can still be aware of the existence of methods and do the import for you. This eliminates most of the need for having it be in the root for convenience purposes.

Second, extension methods are particularly vulnerable to collisions with other namespaces. We've even had instances of collisions with the .NET framework itself.

Sorry if this is initially inconvenient for you but the worst possible case for old code is a cross-cutting addition or replacement of one using statement at the top of most files, and for new code possibly just changing your "normal" to be using .Tools instead of, or in addition to, the root, but again if you just start coding R# should take care of everything for you.

william-gross commented 4 years ago

Ok, this makes sense. I will include using Tewl.Tools in EWL item templates so you get the extension methods in intellisense right away without having to type a full method name for R# to recognize it.