Hacker News new | ask | show | jobs
by hologramofham 1 day ago
> Then Fable 5.2 and Carbon 4 dropped and were able to consistently solve multi-step sections of the pipeline with a single freeform agentic step. Significant portions of my original scaffolding were obsolete by week two!

> It was a gut punch for a day or two ...

Hmm, but didn't your original work serve as the basis/context for what they did? If so, it wasn't wasted work at all, the agents may not have done a good job without it!

6 comments

> Hmm, but didn't your original work serve as the basis/context for what they did? If so, it wasn't wasted work at all, the agents may not have done a good job without it!

This is a double edged sword. More often than not, I find Opus/Fable respecting previous architecture to the detriment of improvements. I find it is often more efficient to just start from scratch.

I think many of us need to rework how we develop in future. A lot of us just start coding and figure out the structure as we go. My colleague getting stellar results with LLMs begins with the documentation. He spends days or even weeks hammering out the exact architecture, UX, processes, components, frameworks, etc. Then he gets multiple sets of eyes on it, including LLMs, for multiple revisions. Once that's locked down tight - including a sign-off from the stakeholders - he throws it to the LLMs and it's effortless. So are changes, revisions, and bug fixes, because the LLMs have a clear understanding of the parameters. Feature changes all start with the documentation.

So interestingly, I have almost the opposite philosophy. It would be interesting to compare notes.

My philosophy is that agentic engineering works best when the code is compact and straightforward, and there is no documentation to confuse the source of truth. The code is the documentation.

What is the purpose of documentation to begin with? It's a shortcut to compress the structure of a system into a quickly scannable map. Or for closed-source software, it's a stand-in for actually being to see inside the black box yourself.

But why would you write documentation about a system that already sufficiently describes itself in an understandable format? What the program is and what it does is already abundantly clear to the model, because it can absorb all of it at once (or all of the relevant pieces at once).

I understand what you're saying about using documentation as requirements and a system design guide. And that definitely stands out as useful. If you can anticipate the architectural tensions ahead of time and encode your decisions about them in the documentation, then you don't have to encounter them and unpack them in the middle of surgery.

But after thinking this over, there is one thing I see missing from my method. The code itself already describes exactly what happens, but it doesn't provide any information at all about which choices in the algorithms in the architecture are just straightforward implementations and which are consequential to the system for outcomes, customers, industry-specific requirements, etc.

You and I typically hold those things in our heads and remind each other of them as we collect years of experience on a codebase. But every time I asked an LLM "but why would it be implemented that way?" I get almost a readback of the code itself. Something like "Because Var X depends on it." Yeah. Well. Why does Var X depend on that? Where is this all going? What does it touch in the DB and the UI?

I think the challenge of the code is the documentation is with current context windows the agent cannot keep the entire codebase in mind at once.
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.

I agree with your point and suspect you're right in terms of where things will go. One challenge I've found is most of the LLMs want to be extremely verbose which blows up context with comments and unnecessary detailed description so when you have an LLM write lots of the code I've struggled to keep it concise. I've found the good context the LLM needs is why an element exists and what it is intended to do and not a detailed description of the mechanics, because as you pointed out the LLM can just inspect the function to understand the mechanics perfectly.
I’m curious: do you not use _any_ documentation at all? or do you just keep it minimal?
but they can use the existing code base to understand what you were trying to archieve, write the spec document.

then you can start fresh armed with that document.

I have tried this but don't you find it ends up writing a very poor spec doc? For example, it will specify the component must use .NET only because it is currently written in .NET. In fact, it doesn't need to be .NET, and if it performed some investigations, it would discover that Rust would be better. So much of code is not intentional design choice. It just ended up that way for a thousand different reasons. In fact, all code contains inefficiencies, and when an LLM documents those inefficiencies as "specifications," I end up with worse code.

I can mitigate this somewhat by asking it to refactor while it's going, but there are still countless taste decisions which it infers. That could be the framework, mono/micro-architecture, integrations, rate limits, API complexity, auth, etc.

Maybe I'm just working a lot with badly written code, but I hear this complaint a lot.

i would let the spec be completely agnostic of the tech stack. and just ask to turn this into a description to hand to a product manager and their team, as i have to revise the software and it needs to be a cleanroom implementation. so the spec needs to cover minimum all the current capabilities.
The problem remains taste, context, and institutional knowledge. If the API rate limits 100 queries/min, is the model going to call that a specification? So often the only reason the rate limit exists is because seven years ago the environment used didn't have enough CPU. It has long since migrated to a new cluster and it can now handle 10,000 queries/min. And if the model doesn't consider this a functional spec, what if that's actually kind of important for the architecture?

It sounds like we work on VERY different kinds of projects. I'm closer to infrastructure and these details make big differences.

that's why you _read_ the spec document.
Read, in detail, analyse, update, etc. Which is what I recommend in my second paragraph :) It's just a lot of manual work which the LLMs cannot do.
This is the way, I think.

You go existing codebase —> feature spec —> new codebase with a very adversarial agent in the middle driving a live version of the product and validating every statement in the spec by checking its behavior.

It takes some scaffolding, but I’ve had good results.

That's an interesting perspective. It's hard to know if it is true but this might explain it... hadn't thought of that...
Seems like human written code has a similar fate.

I’ve rewritten huge code bases, using the learnings to do it better. Sounds like that’s what they did here…

Reminds me - per Joel Spolsky, “Things You Should Never Do” (April 2000 blog[1]) - is totally rewriting mature software no considered such a bad idea?

[1] https://www.joelonsoftware.com/2000/04/06/things-you-should-...

I think it’s no longer something to dismiss so readily.

I wrote a bit about it during the summer[1], the trick is that a rewrite spans the gamut from rote transliteration to reconceptualisation. I argue that the bar has been lowered, but not removed.

And as ever, “it depends.”

1: https://duggan.ie/posts/the-dream-of-v2

One of reasons not to rewrite was that it's costly and the difficulty of the project is usually underestimated. As a result either it takes much more time than expected or a rewritten product becomes a gutted version of an old one (with less features and more bugs). LLM drops the cost so at least one of arguments has gone.
My insight into this, is that a legacy codebase often contains years of business decisions, pivots and hidden external and internal non-software logic baked in; you are always risking accidentally culling that knowledge stored in the codebase.

Often the risk is because said knowledge was poorly codified into the codebase, presumably that's part of why you're looking to refactor.

But if a legacy system in a big business has been running for a while I generally suggest just improving it in place. Modularise components and slowly modernize piecmeal until you've got something easier to work with and more stable.

AI doesn't really impact any of that process except speed of executing the coding aspect, I feel.

Do in a greenfields rewrite and someone from another business unit will ask why the barcode scanner doesn't accept an extra digit anymore, and you'll find you missed an overriden module that added support for pick and pack to sharpie in a line as a signal for freight that it should ship the next day (or some other wild bs production hack)

In a field that changes as much as technology, rules that are 26 years old often need to be reconsidered, at least.
That can be true for carefully vetted work, but I've consistently seen the better models (e.g. Fable) perform better when not given an earlier draft by a less capable model.
If you and all the others working on getting long running agents hadn't been sending daily progress updates to anthropic, they might not have been able to make Fable either.
I agree, the original work provided curated context to help improve it even more.