3 ms·
C# also did not mandate having one namespace per file. Devs have adopted a "one namespace per file" rule because it's generally a good idea. So now the new "fi
by SideburnsOfDoom 4y ago
C# also did not mandate having one namespace per file. Devs have adopted a "one namespace per file" rule because it's generally a good idea. So now the new "file scoped namespaces" allows only 1 namespace per file; and if you want more than that, well then your namespace can't be file-scoped, by definition. You can still use namespaces with { } in that case.
The same _could_ be done with type declaration such as classes and interfaces. If it would be beneficial idea is another thing.
- Kwpolska 4y agoSure, but “one namespace per file” is a much more obvious idea than “one class per file” (especially with C# IDEs aggressively tying namespaces to the filesystem layout).
- foobarbaz33 4y agoWhat draw backs are there? I can't think of any beyond the initial WTF factor of seeing functions living free of braces {} prison. Multiple classes per file with would still be an option of course.