Namespaces in C# vs imports in Java and Python

后端 未结 6 1488
一整个雨季
一整个雨季 2021-02-20 03:21

In the Java and Python world, you look at a source file and know where all the imports come from (i.e. you know in which file the imported classes are defined). For example:

6条回答
  •  情深已故
    2021-02-20 04:08

    In C#, there does not seem to be such a convention for namespaces, or am I missing something?

    I don’t know about other projects but I’m pretty sure that in every .NET project I have worked on, we used this convention, i.e. namespaces always corresponded to folder names (except for the outermost namespace(s) which correspond to the assembly from which the namespace comes).

提交回复
热议问题