What Would You Say for... File Tagging?

goyo

Grzegorz Ziemonski

Posted on January 2, 2019

What Would You Say for... File Tagging?

For the past few years I spent quite a lot of time pondering the topic of code organization. Where does this file go? Do we split the files by architectural layers or by business areas? That sort of thing.

A few days ago, when doing something completely unrelated, an idea popped into my mind and I'd like to share it with you.

What if, instead of (or alongside) putting files into a single, fixed layout of directories, we simply tagged them (just as we do with posts on DEV) and then based on these tags we could create all the layouts and hierarchies that we find useful?

The tags and layouts could be specified in some sort of file in our repo, say in JSON or YAML:

{
    "tags": {
        "controller": ["src/controller/user-controller.js", ...]
        ...
   },
   "layouts": {
        "layers": ["controller", "model", "view"],
        "domain": ["orders", "catalog"],
        ...
    }
}
Enter fullscreen mode Exit fullscreen mode

Then, based on the tags and layouts that we specified, our text editor/IDE could allow us to conveniently browse the files:

What do you guys think? Would it help you organize your code? Or maybe it solves a problem that's only in my head and nobody else cares?

Also, let me know if something like this already exists. I tried searching online, but apparently I used the wrong search terms.

💖 💪 🙅 🚩
goyo
Grzegorz Ziemonski

Posted on January 2, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Discuss moment
undefined Discuss moment

November 29, 2024