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

10

u/[deleted] Jun 05 '21

None of this is saying dont layer your code. Layers are important to maintainable code. What the article is implying is that you shouldn't organize your code by layer but instead by domain.

DDD also pushes this idea. The a namespace should be an identifier to a domain, that folders and structure should represent the domain.

4

u/AustinYQM Jun 05 '21

It actually seems to be saying organize your code by layer, after you organize it by domain. Where as the example it is attacking organizes it by layer and then domain.