Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project files' tree

Are there any articles or recommendations how to organize file hierarchy in your project? I am interested in how to name folders, to separate sources and headers or not.

I have project written in C++, a library and project using it. Library has many components, they are separated from each other but some of them use common files. Should I create directories for them?

I will be glad to hear all recommendations.

like image 977
Yevhen Avatar asked Dec 21 '22 19:12

Yevhen


1 Answers

Do not split headers and source files into separate folders. It does nothing more than add an extra folder level.

At best it is completely useless; if you're looking for "widget.h" you can trivially find it even if there's a "widget.cpp" right next to it. At worst it's rather counter-productive - e.g. when you're editing "widget.h" and find that you also need to update "widget.cpp".

like image 61
Roman Starkov Avatar answered Dec 24 '22 09:12

Roman Starkov