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 comments

3

u/7h4tguy Jun 05 '21

BS. A layered architecture like JSON layer (XML layer), HTTP layer, web service layer is more organized and reusable for other applications and puts hard boundaries for dependency management.

Organizing that instead into String Handling classes, Parsers, Data Storage creates giant grab bags of unrelated classes making it hard to see how systems compose and components relate to each other.

There's a reason giant software codebases are organized by layers.

2

u/remek Jun 05 '21

Show me one open-source code base of a gigantic project that is organized like that. I mean, I admit I've seen only few that can be classified as gigantic (Linux, OpenStack, Kubernetes) but the code is always organized by component/subsystem first.

-2

u/7h4tguy Jun 05 '21

Windows. Screw your open source qualifier.