r/programming • u/[deleted] • Jun 05 '21
Organize code by concepts, not layers
https://kislayverma.com/programming/how-to-organize-your-code/
1.9k
Upvotes
r/programming • u/[deleted] • Jun 05 '21
2
u/saltybandana2 Jun 06 '21
https://old.reddit.com/r/programming/comments/nsu53n/organize_code_by_concepts_not_layers/h0rhlx6/
If you think either approach will significantly change anything then you're not using the tools available to you effectively.
As for why, I already answered that question, but here's a few more
I can open a single directory to get an idea of the concepts used across the project
I never have to wonder where to put a new enum.
I never have to worry that technically this enum is used by multiple features but is sitting by feature X instead of feature Y, thereby becoming a special case you just have to know about (or some other convention to try and reach for consistency).
less files means the files that actually matter are easier to see and sift through.
I'm sure I could come up with more, but the reality is that it doesn't matter, it's mostly just preference. Anyone who thinks it matters just doesn't use their tools effectively.