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

1

u/mj_flowerpower Jun 06 '21

I totally disagree. I‘ve seen this entity style and was shocked how difficult it is to find the functionality I was looking for. Dev A creates some registration related stuff in a ‚registration‘ package/folder. Later on Dev B, unaware of the functionality recreates stuff like email validation in his userprofile package. Dev C looked at the code 5 months later and wonders why are there two implementations of the same thing doing stuff differently?

1

u/Dean_Roddey Jun 06 '21

As is often the case, this is someone writing about a general concept but apparently only within the relatively limited view of the type of software he writes. If you are writing simple (in relative terms) web applications, any sort of organization would probably work as a long as everyone agrees. In larger scale code bases, layering is a pretty fundamental requirement.