Finding files and deciding where to put them are different jobs. Your folder structure needs to account for both.

18 points•alwaysDrafting•about 2 months ago•7 comments•

7 comments

MiroslavPokornyabout 2 months ago
The folder structured shared is broken for the simple fact that artifacts are categorised by programming type rather than usage. As an example all models are grouped together broken away from the services that may be using them. This means the relationship between a collaborating system are never colocated.

I fail to see the value of grouping all models together, maybe its me but i would rather that collaborators are co-located. I cant see any value to have all models.

notpushkinabout 2 months ago
Agreed. I’m trying to group files roughly by “feature”:

  src/features/
    auth/
      models.xx
      api.xx
      components/SignInModal.xx
    todos/
      models.xx
      acls.xx
      api.xx
      pages/Todo{List,Create,Edit}Page.xx
Naturally, there’s some code to glue it all together and some shared services, and it’s still a mess sometimes, but overall when related things stay close to each other it’s easier to comprehend.
MiroslavPokornyabout 2 months ago
Maybe its me, but wouldnt the auth feature only have 1 or 2 models at most ? Same question for API and components, pretty sure you could put them in the parent directory and the names of each shoudl make their core responsibility obvious.
theknarfabout 2 months ago
Neither of these are good examples of organization. You should organize stuff by feature (without having any folders called "feature", "shared", "core" or "utils"). Essentially the rule for organization is simple; the moment you have any folder that is a catch all you have lost.
tancopabout 2 months ago
Another reason why tags are better than folders. If your team can't decide between different systems just use all of them. Then you can group by feature, layer, role, author or anything else you need right now.

The problem is no existing file system supports this so you can only use it to organize notes or issues not your code.

1718627440about 2 months ago
> The problem is no existing file system supports this

Use sym- and hardlinks?

Read the full thread on Hacker News →

Related stories