Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Project Files Organization  (Read 5282 times)

0 Members and 1 Guest are viewing this topic.

albert_lazaro

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Project Files Organization
« on: May 27, 2021, 07:19:06 pm »
Good afternoon,

I am doing a game with SFML and now I'm doing some refactoring. I have a doubt about how to organize the files. Currently, I have the source files in the Source folder and the headers in the Header folder, but there will be more files in the future so I want to do some tidying.

For example, I have moved the source files for the GUI in Source/UI and the headers in Headers/UI, where I put files like Label, Button, Container...

I have navigated through some projects in Github and I see that people tend to put all files in Header/Source folder without subfolders.

My idea is to have an easy to uderstand project and try to make a clean project.

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Project Files Organization
« Reply #1 on: May 27, 2021, 10:12:47 pm »
y la pregunta?  ;D

to be honest, most codes I see also have all source files shipped in the same folder, simply because you usually open them directly from the IDE... but i believe very big projects (like let's say, GTA V production) have lots of folders like you do. not a big concern, its up to you
Visit my game site (and hopefully help funding it? )
Website | IndieDB

albert_lazaro

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: Project Files Organization
« Reply #2 on: May 28, 2021, 06:57:59 pm »
Well, the question is more about how people organize the source code in their projects... If they follow any rules.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: Project Files Organization
« Reply #3 on: May 29, 2021, 11:02:12 am »
That's an interesting question. In the world of C++ which is peppered with people preaching best practices and codes of conduct, I've never really seen an article or heard someone talk about file organisation. That's not to say no one ever has, I've just never met them :)

Personally I think it's down to preference, although the type of project does influence how I lay out my source directory. For instance both of my libraries have a relatively oragnised structure with files placed in directories based on what they do, eg graphics or audio. The header files are arranged like this too (much in the same way as SFML's) because it makes it much easier to include them in another project.

On the other hand, for projects which use those libraries I tend to dump all the files in a  single src folder, or possibly split them into src/include. This is mostly down to laziness as I tend to assume that, unlike libraries, I'll be the only person that ever really uses them :)


Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Project Files Organization
« Reply #4 on: May 30, 2021, 01:37:35 pm »
I've never really seen an article or heard someone talk about file organisation.

me neither. i usually just put everything together, but as I said, I never participated in a big project.
thinking about it, iirc Tgui and SFGUI subdivide their files in subfolders
Visit my game site (and hopefully help funding it? )
Website | IndieDB

 

anything