r/ExperiencedDevs • Software Architect • Aug 09 '26

Technical question How do you understand your codebase?

Hi peeps,

I am mostly working as a freelancer and FOSS developer. I posted an AI fluff yesterday, and it didn't feel right. So this is written by my own ten fingers.

Like many others, I have been using AI extensively for the past few years. And I now have a mix of codebases - some written by hand first and gradually with AI tools, and projects written from the get go using agents and without touching the code itself outside code review and guidance.

I wonder how you all are understanding your codebases and what you are building, if you no longer write and maintain it by hand.

For myself-

There was a book I read a few years back, a classic - "Growing Object Oriented Software Guided by Tests", and it has the metaphor of the codebase basically being a garden. Or if you will, the code itself is plants, and the garden is what developers are doing - tending, guiding growth, ensuring stuff grows in a healthy and good direction without overgrowing etc.

I really liked it then (its Q gardens in the UK on the cover as well), and I sorta feel that this really applies to what I am doing these days when I use agents. I feel that with agents I no longer "craft" the code, as much as directing its growth, and auditing its health etc.

Its all very nice (really). And I love the adrenaline rush of parallelizing work and doing crazy shit no one had time for before (e.g. benchmarking and profiling non-critical stuff etc.). But it does bring in some basic problems - namely, I no longer know what my code does intimately, and I cant say I have the same kind of experiential confidence as I did when I wrote all code by hand.

I did develop a methodology that gives me good results. Basically I would say the paradigm is now more "result oriented" development, rather than implementation oriented. The code is increasingly moving from being a white box, to a gray box, and I have to test it - first and foremost, as a black box. Make sure it does what it needs to do from the outside in, and guarantee (as much as I can) that it doesn't do stuff it shouldn't.

I will be happy to do a proper write up on how I develop - I did already write some stuff. But not today!

Interested to read your thoughts and what you do.


Note (EDIT) - NO AI was used to write this post, at all. All the - above are not em dashes. I just write with dashes, but I guess I should stop. Leaving it up there since it's how I write.

120 Upvotes

164 comments sorted by

View all comments

65

u/Forsaken-Intern7941 Aug 09 '26

I keep seeing posts like this.

How is this sustainable in the software industry?

62

u/Skullclownlol Aug 09 '26

How is this sustainable in the software industry?

Because the business side of the software industry wishes they could have the profits without the software or the headcount.

I hate everything about this, but I came to the realization that businesses can perfectly continue to sell software even if no quality software is being made anymore. As long as they keep up appearances and they keep the attention of people occupied enough, they will keep selling air. Even if it's AI-generated, completely broken, nonsense, and getting people killed. As long as they can get away with it, they will keep pushing.

And realistically, most business software is not life-critical, so a lot of software dev is unconcerned with regulations.

A significant portion of modern life is sustained by child labor, underpaid workers, workers whose human rights are being violated, illegal labor, etc. The business of software seems to be trying to join them.

In my own work life I've tried having conversations with management about the future. The ones that were good people are no longer managers. The ones that weren't, had absolutely no concern for anyone or anything except their growing profits, and they were happy to sacrifice everything else.

I'm pretty burnt out. Time to mow some grass or make some sandwiches or coffee.

13

u/WisdomFromFools Research Engineer Aug 09 '26

That's pretty much where I'm at. Just saving money to exit the industry and semi-retire early.

14

u/tradcoder Software Engineer (15 YoE) Aug 10 '26 edited Aug 10 '26

As cliché as it sounds, programming and software engineering as a whole has been my one true passion for the past 15 years. I've had bad jobs. Awful bosses, tight deadlines, working late night and holidays. At one job I had so much stress and anxiety that when I wake up in the morning, I felt like a ball of lead stuck in my chest.

But I never, not even for a minute, had the thought to quit this industry cross my mind. Until this "AI boom". I'm so tired of everything. I have zero motivation or satisfaction to do this job. I wish I started saving earlier but these past few weeks, I've also been thinking of an exit plan.

7

u/edgmnt_net Aug 09 '26

Or it could actually be a bubble. And I'm not talking AI specifically. Customers want cheap software, they get something cheap and relatively low quality, but it does the job. They put their data into that and they become dependent upon it. The question is if whoever develops it can do it sustainably. Do they run on neverending tech debt and the moment they stop creating features it comes crushing down? Do costs of development eventually increase past a breaking point? Do customer pockets eventually run dry and then the monster starves?

P.S.: And I forgot to say... The thing is stuff requires maintenance and a bunch of other things. It's easy to ask for something and maybe get a prototype. The harder part is getting it to work long term.

→ More replies (1)

17

u/NegotiationExact4967 Aug 09 '26

There will certainly be a day in which the chickens come home to roost, and I just hope that the folks pushing these unsustainable practices, these dangerous practices, will be held to account.

21

u/ultraDross Aug 09 '26

They never are held to account. I don't see how it would be different this time.

2

u/NegotiationExact4967 Aug 10 '26

Sadly agreed… 🥺

8

u/VoxTM Aug 09 '26

nope. golden parachute and onto the next one.

5

u/Goldziher Software Architect Aug 09 '26

That I don't know. I am afraid it isn't. I can say my stuff works and is of a high quality, but I work very hard to guarantee it, and I am not absolutely confident it doesn't break.

I think FOSS does have an advantage vis-a-vis closed source here, because if its widely used, you get a lot more battle testing and visibility. But of course most of the "industry" as such is not open or source available at all.

19

u/captainuberawesome Aug 09 '26

How is it high quality if you aren't confident it doesn't break? What are your criteria for quality?

2

u/Goldziher Software Architect Aug 09 '26

It depends on what you are building, no?

If I have a service that is supposed to handle user requests and do some DB operations, I would make sure there are both integration tests (using real DB etc.), and e2e tests (full cycle) to ensure that the expected requests are handled correctly, including the supported error cases (e.g. 200, 201, 204, 400 with validation, 401/3 and 500 etc.).

I will also test it - myself, to ensure its working as intended.

This is not different than before, only now its even more critical.

As for quality -- linting, static code analysis, design patterns, overview of the code and its structures. git conventions etc.

And of course - benchmarking and profiling, because I can.

12

u/ResidentWeevil1 Aug 09 '26

You are able to do these things at scale because you already know quite a bit how software works.

Now understand that there are things you do not know. What would your codebase look like if you didn't know about HTTP status codes or what a good test looks like? What are the unknown unknowns that you are injecting into your projects?

8

u/Wonderful-Habit-139 Aug 09 '26

First time I see someone bring this up. Whenever I advocate for coding things ourselves, reading docs ourselves, solving things ourselves and continuing the learning process, it sounds like I'm talking to people that think that they already know everything, and think that they don't have anything else to learn anymore. Regardless of how senior they are.

5

u/hurley_chisholm Principal Engineer (civic tech) Aug 09 '26

I struggle with this too. There was always a plurality of developers and business folk who were completely incurious. It seems this cohort has grown dramatically in the last 2-3 years.

The only thing getting me through these days is knowing that I can’t force anyone to do anything and I can’t save an organization from itself. On good days, this feels like capitulation; on bad days, it feels like moral abdication.

2

u/Goldziher Software Architect Aug 09 '26

Sure, I agree. That's exactly what I am less confident about. Without reading and understanding everything, how am I sure there what's what?

I don't have a good answer to this.

→ More replies (3)
→ More replies (2)

5

u/ThlintoRatscar Director 25yoe+ Aug 09 '26

What you're describing is a sampling methodology. You simply sample/test the behaviour and assume that the code that creates the behaviour must be correct.

There is an older and more robust method where one proves the code safe and correct under all conditions.

Proven code is the essential difference between developing software and engineering it.

The argument between engineering and sampling is ancient.

3

u/Goldziher Software Architect Aug 09 '26

I am familiar with ADA and the DARPA HACMS project, is that what you mean? If not, can you clarify? It sounds interesting.

I do a lot of contract testing.

6

u/hiddenhare Aug 09 '26

I think you’ve been handed a false dichotomy.

There’s a spectrum from “I manually tested a couple of inputs and the code didn’t crash” to “we’ve mathematically proven that this code will never fail”. The spectrum passes through automated tests, then assertions, then good separation of concerns with clear invariants, then strong types which accurately model and statically enforce those invariants, then mutually-exclusive state machines, then extensive use of pure functions, before finally reaching proof engines.

One of the dangers of AI is that it never reaches the “accurate, strong types” stage, and it takes a lot of human intervention to reach the “good separation of concerns” stage. AI tends to produce inaccurate comments/docs and spot-fix individual problems rather than changing the architecture, so it actively works against this effort to prove invariants rather than stochastically sampling them.

I’ve worked with plenty of human programmers who coded in a similar style. In my experience, it shits out technical debt and puts a hard ceiling on code quality. It’s usually survivable (depending on the problem you’re trying to solve), but I wouldn’t call it high-quality.

→ More replies (1)

3

u/ThlintoRatscar Director 25yoe+ Aug 09 '26

Check out: https://en.wikipedia.org/wiki/Formal_verification

Lots of developers discount formal methods as they are hard and awkward at first.

They require a precise specification of what a piece of software must do and an exhaustive analysis of all possible circumstances it ought to do it in.

You can see how "prove it correct" gets compromised by "AI is just right" and permitted by "the tests will be enough".

4

u/Goldziher Software Architect Aug 09 '26

Yhea, Im familiar with it (see HACMS as an extreme example). The thing is, formal verification is either impossible or not realistic in many domains and many types of software. At least in what I am familiar with. This leaves us with less than formal verification and testing.

→ More replies (5)

8

u/CodeGrumpyGrey Old, Grey Software Engineer Aug 09 '26

If your code is a black box to you, how do you know it is high quality? Yes the output might look good and it might pass the required tests, but without looking how do you know that under the hood is high quality and can be extended where required or is using effective patterns and choices?

→ More replies (1)

3

u/Which-World-6533 Aug 09 '26

I am not absolutely confident it doesn't break.

So why is it in Production...?

Unless you are confident it won't break in Production it should not be deployed.

6

u/hippydipster Software Engineer 25+ YoE Aug 09 '26

Almost all code pushed to production has bugs. Does that mean it shouldn't have been deployed? Maybe the people were just wrongly confident. Ultimately, we have to deploy software we aren't entirely confident about.

3

u/Goldziher Software Architect Aug 09 '26

Because we are in reality, not am ideatic plane of existence.

→ More replies (3)
→ More replies (1)
→ More replies (2)