C++ – Project structure and folder naming

cfilesnamingproject-structure

I have a cpp project which source code I want to split into 3 groups and want to define structure for these files by creating folders with nice name.

First group are files related to socket communication. These files contains implementation of company protocol used over the UDP socket. In future there will be another interface implementation over HTTP. It is some kind of interface to the cpp application. Therefore I named it interface.

Second group are files which implement wrapper over 3rd party library + some business logic. I want to name it according to 3rd party library. Reason is because may be in future we will support also other 3rd party libs – so we can have better source code organization.

Third group is currently only one file which contains main. I have not created folder for that and just place it into project folder. This file is connecting necessary pieces from interface folder and 3rd_party_lib_name folder.

+-demo-app
    +-interface
    |    UDPSocketImpl.cpp
    |    UDPSocketImpl.hpp
    +-3rd_party_lib_name
    |    WrapperOf3rdlib.cpp
    |    WrapperOf3rdlib.hpp
    |    BusinessLogic.cpp
    |    BusinessLogic.hpp
    | DemoAppMain.cpp

My question:

What do you think about the project folder structure and names?

Best Answer

That sounds fine.

I wouldn't worry too much about this. Being thoughtless about the structure is a problem. But as long as you come up with something organized in a reasonably logical way, which would be understandable to others, you should be fine.

This isn't something where perfectionism is likely to be worth it, especially on what seems like a small project.

Related Topic