Best way to organize the files in my project

后端 未结 3 878
自闭症患者
自闭症患者 2021-02-11 06:20

What is the best way to organize the files in your project?

For example do you put all user controls in a separate folder or do you place them in a sub folder? Do you h

3条回答
  •  伪装坚强ぢ
    2021-02-11 07:10

    First the purpose of folder separation is to be an extra level of documentation, to let the programmers find code easier. That means you should not have extra levels "just to organize stuff". That excludes folders named Classes, Controls, etc.

    Some examples:

    If you work on a thee tier App it would make a lot of sense to have something like:

    Project\Tier (Model|Controller|etc)\Classname

    If you program is big to the point of having separate functional areas I would go with:

    Project\Functional Area\Tier (Model|Controller|etc)\Classname

    That is particularly usefull when sub-teams work on the different functional areas.

    Also refrain from very deep folder trees (IMHO, more than depth 4 is too much) and keep your folder names compact. Some tools might have limitations on path size as low as 255 chars, so this is one place where brevity has its place.

提交回复
热议问题