如何避免类名和名称空间冲突?

问题描述:

有时我需要调用名称空间并对其进行相同的分类.例如,SomeProject.Compiler命名空间,其中包含许多与编译器相关的内容和主入口点类Compiler.但是不建议将名称空间和类名称命名为相同名称,因为这会造成歧义并误导编译器.
有什么想法,如何给它们起更好的名字?

Sometimes I have need to call namespace and class the same. For example, SomeProject.Compiler namespace, containing lots of compiler-related stuff and the main entry point class Compiler. But naming namespace and class name the same is not recommended, as it creates ambiguity and misleads compiler.
Is there any idea, how to name them better?

始终可以提供通用名称空间名称,该名称描述了其所有成员.例如,使用CompilerServices而不是编译器.

It is always possible to give general namespace name, which describes all its members. For example, CompilerServices instead of compiler.