Skip to content

contributing_directory

Rafael Corrêa Chaves edited this page Jul 18, 2021 · 1 revision

It's impossible to have an organized project without organizing your directories. So this is the first thing we will be talking about when contributing, let's explain the theory behind our principle:

Category vs functional

What we subconsciously do is create directories to organize things, but we do separate them by two types: categories and functions. Category is a directory that contains the same function, not changing it and keeping the same type of content inside each. For example:

- app
  - controllers
    - auth
    - assets
    - repositories

As you can see, inside of controller we have directories separating by categories, they are all controllers and each directory won't fine-grain it's structure. Now functional directories will do alter their structure or fine-grain it further, example:

- controllers
- models
- validators

Those directories contain different types of script, that serve different types of function and differs in it's structure.

Why we shouldn't mix them

Let's go back and take a look at the first example, imagine that repositories are actually talking about the repository design pattern and not controllers that deal with a model called repositories. You would be disappointed in not finding what you assume would be there, since looking to it's directory siblings, they all look to be talking about categories. And now that the logical lookup didn't work, you would start the manual lookup, opening each directory or looking up in a finder/search tool.

This highly disapoints newcomers and generally tend up to grow into grotesque structures that will be both ambiguous and subjective, something that can highly prevent your code from being organized.

Clone this wiki locally