I find that sometimes I have the need to have multiple namespaces in a project I'm working on - are there any problems that may arise from having multiple namespaces in the same project?
The alternative is obviously having multiple projects (per namespace) in the Solution.
Yes, it's fine. Often my namespaces align to the folder structure of the project. So the top-level namespace might be the same for the whole project, but there would be multiple sub-namespaces.
The purposes of namespaces are (1) organization and (2) avoiding naming collisions, not necessarily in that order. Whereas, separating things into multiple projects is more because you want multiple binaries or you want to share code between multiple solutions. These are somewhat orthogonal concerns.
Yes many classes to a single namespace. Many namespaces in a project is totally fine. It is cosmetic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With