| That's true, and sometimes it's unavoidable, but I'm arguing that the first move should be to compact the codebase and rely on documentation only where the codebase is too sprawling to fit in context. And I don't mean that you should try to fit the entire codebase into one context window. Anything bigger than a little to-do app is going to grow past that really quickly. I mean that we should get rid of the abstractions and cruft that we used to rely on to make the codebase understandable to humans so that more and more of the causal structure does fit directly into one context window. Get rid of anything that's there to make everything fit into neat elegant abstractions. Keep everything that creates a single source of truth. But IMO repository patterns, data transfer objects, and boundaries that exist for conceptual reasons alone should all disappear. If I have a front-end UI framework that has nested components on a page that call an AJAX/fetch class with models that call the server, which has an endpoint with a matching data transfer object that maps onto a business-layer model that is manipulated through a repository class that calls an ORM that modifies a data model in a database somewhere, that is a useful separation of concerns that helps a human programmer reason about how the program works through learned architectural consistency. But it's also potentially 10 to 20 files to go from button click to UI change. I would argue that shifting to a server-rendered application with a thin database abstraction is better, because it's two or three files to understand exactly what the button click does. It's more possible to hold that entire structure in context, and therefore also more of those structures. You don't need to feed it a bunch of documentation about how things are organized, why they're organized that way, what the system does, and how you designed it to behave. It's all evident in the two files of code. So I'm not saying it's always possible to hold everything in context and documentation is useless. I'm saying the stronger move is to compress the actual architecture first, and then only document what's still sprawling and complicated. |