Modules - where to locate them in a project?

Having read the documentation about modules, I understand that they are kind of a combined equivalent to .c and .h files in C. Is this correct?

Next, I try to figure out when and where to place modules in a project and how does this depend on what I want to put inside. Taking the ‘EddiesElectronics’ sample, there are constants declared at top level ‘Constants’ and in a module named ‘Strings’. Why is it organised like that?

Thanks in advance.

AFAIK, where you want / prefer / makes sense for you.
Just like Windows, images, etc.

The way I work is that I place them at the top of the tree in the Project Explorer. If there are more than one, then I create a folder called Modules and put them inside this folder.

The project will always compile wherever the modules are in the tree, but since Modules are in some way components for the project, I put them at the top. The demos are a good source to learn, but sometimes the code quality lacks :roll_eyes:.

Thank you @Gilles_Plante!

I don’t remember where I got this quote: ‘coding is both a craft and an art’.

1 Like