I want to know which are the rules so i can figure out what code files should be put in the "core" directory (and sub-directories), because i didn't get it yet.

I was thinking if it's about code that the user doesn't interact with directly, like database management ones, for example... Is that it?

Thanks in advance.

PS: By "core" i mean it's named "core" indeed.

  • What do you mean by "core" directory? A directory literally named "core"? A directory that is not necessary named "core", but which is somehow more special than any other directory?
    – 8bittree
    Commented Nov 8, 2017 at 21:31
  • 1
    @8bittree Yeah, it's named "core". I often see this directory in projects on Github. I'm a beginner and i don't understand directory-structure well. This is why i'm asking here. Commented Nov 8, 2017 at 21:47
  • 4
    @inovapixel There are no rules. Commented Nov 8, 2017 at 22:04
  • Software projects, notably small ones (e.g. less than a hundred thousand lines of source code), don't need to have sub-directories for their source code. Commented Nov 9, 2017 at 5:34
  • 1
    The answer is: whatever you think makes sense. The problem is, that answer is very broad, and so the question is too broad. There are a lot of conventions out there for directory structures (source and include for C++, modules for java, etc.) it really just depends on the language you're using. Some projects use more than one language. Can you see why there's no real answer to this question? Commented Nov 9, 2017 at 8:55

1 Answer 1


The short answer

Whatever you want. Possibly even nothing at all.

For reference, here are three major open source projects that don't appear to have a "core" directory at all:

  1. Git
  2. npm
  3. Vim

I won't claim that those three are paragons of the perfect project directory structure, but they seem to have been fairly successful without a "core" directory.

The longer answer

Your employer may have requirements for how you lay out your project's directory structure. We can't answer that here, you'd have to ask your employer if that's the case.

The tools you use may have a preferred or even a required layout.

Your teammates may have a preferred layout. Again, talk to your teammates, not us.

But, absent any of the above three forces, you can basically put things wherever you want. And even in the case of tooling, you can usually override the defaults. Just keep in mind that your future self will have to understand where everything is. And if you're interested in future collaboration, a complicated, obfuscated layout is likely to discourage people from helping.

  • You need to be able to find things - but you don't necessarily need to know where everything is, especially if you give things good memorable names and your tools help you find anything by searching for its na,e.
    – bdsl
    Commented Sep 8, 2021 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.