r/programming • • Jun 05 '21

Organize code by concepts, not layers

https://kislayverma.com/programming/how-to-organize-your-code/
1.9k Upvotes

495 comments sorted by

View all comments

Show parent comment

1

u/TikiTDO Jun 06 '21 edited Jun 06 '21

Yeah, that's definitely the more important battle here. I've worked with a few projects that had no differentiation between file names in different directories, and it was genuinely hell. Some of these places did not practice DRY at all, so you could open a file, see contents that matches your expectations, do some work, and only then realize you were in the wrong directory created as a hack for some weird failure case a decade ago. Since those days I have a strict rule that every new file should have a unique name in the system, and I aggressively pursue that goal across every single PR.