Should the folders in a solution match the namespace?

后端 未结 7 832
予麋鹿
予麋鹿 2020-12-02 06:05

Should the folders in a solution match the namespace?

In one of my teams projects, we have a class library that has many sub-folders in the project.

Project

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 06:58

    @lassevk: I agree with these rules, and have one more to add.

    When I have nested classes, I still split them out, one per file. Like this:

    // ----- Foo.cs
    partial class Foo
    {
        // Foo implementation here
    }
    

    and

    // ----- Foo.Bar.cs
    partial class Foo
    {
        class Bar
        {
            // Foo.Bar implementation here
        }
    }
    

提交回复
热议问题