> Large codebases are inevitable.
I vehemently disagree. New codebases might be built on top of large stacks of framework code and infrastructure code, but source repositories ought to actually be tighter and more business-focused than they used to be.
But they're often bloated monstrosities, filled with resume-padding architecture astronaut bullshit, or contorted to fit the latest hip framework's requirements.
Apologies ahead for this long-winded rant, but this exact issue has been boiling my blood for weeks now because I've been wading through the neck-deep mess that a customer has made, such as writing an astonishing three megabytes of source (typed by hand, not generated!) for a single web form. One!
Especially in the era of modern web frameworks, we can avoid most of the "ceremony" of older systems like C or C++ where just making a call to a database was pages of fiddly boilerplate. Instead of embracing this, I see developers reintroducing unnecessary code because they must have gotten so used to the verbosity that they felt exposed without it.
Let me give a concrete example from a codebase I've just spent a week reviewing. I've read through hundreds of pages of code, found dozens of critical resource leaks and security issues, and I'm yet to encounter any actual business logic.
The first mistake that happened was that someone decided to use Angular. Why? It's hip! It's cool! It's what all the kids are doing!
Except now, you have to have an API instead of just web pages. That API will need to serialize things to JSON, so you need to data transfer objects and Newtonsoft code. Suddenly, you need to deal with JWT, and make sure the untrusted client doesn't receive internal (secret) fields from the database. The client is no longer strongly typed or closely tied to the C# code, so you need a full megabyte of test code that you never would have needed before to validate all the Typescript.
This code does nothing of business value. It's a form. You fill it out, and hit submit. There's no "interactivity", there's no single-page-app features used, it's just... waste.
Then, then, on top of that, someone that really likes "grand cathedral" style code architecture decided that this whole thing would be more secure if there was a "middle tier". You know, an API. No, not the Angular API facing the Internet! A back-end API. For no reason. For an app written by two developers that has its own, dedicated database, and will never interact with any other app, tool, or system.
So now you have to write server-to-server API call code including the DTOs and related definitions, the server code, the client code, the service authentication code, the error handling, the distributed tracing, the HTTP header forwarding (securely!), and on, and on.
All typed out by hand, because: "REST is easy!"
No wait, there's more: The original architect also wanted to make the system "database agnostic", so the mid-tier repeats every abstraction. It has interfaces, types, etc... so that you can "swap in" another database. This never happened, and will never happen. This is purely wasted effort.
Then someone put API Management in front of this. Why? Because the word "API" was used. Remember: Angular uses JSON APIs, not HTML, so it's a "thing" that "needs" management. Then that API management -- a cloud SaaS service -- has a reverse proxy in front of it operating in API management mode for "security".
Meanwhile all these layers are riddled with URL injection, SQL injection, and similar basic security errors precisely because it's too hard to add a new field to the form, so developers get lazy and simply add a generic "ExecuteQuery(string sql)" mid-tier method and move on with their lives.
This is why we have "too much code". Because architects can't justify their positions if there's only two icons with a single arrow between them in their designs. Because "hip new thing" is a shiny we all love to chase. Because of magical thinking that assumes that more abstractions means the code is more good.
We have nobody to blame for this but ourselves.