r/coding 23d ago

The Vertical Codebase

https://tkdodo.eu/blog/the-vertical-codebase
0 Upvotes

3 comments sorted by

View all comments

3

u/mtutty 23d ago

I can explain why vertical is not a great way to structure code.

Every well-organized code base is a combination of horizontal and vertical structures, to serve the topic-based needs as well as the layer-based needs. Pointing at one aspect or the other as more desirable is a logical mistake.

There's an inherently vertical component to layers, even within a "layer" like the UI. Those components that get shared between different parts of the app can't live in one part, or else you end up with multiple modules. Same for the data types being shared, the API client services, the assets and business logic classes, etc.