zacharyck.com / content / a program from scratch

If you wish to make a program from scratch

...you must first invent the universe


We've all been there. You've got an idea for a neat little script or webpage, so you type out your thoughts to an LLM of choice, and have it put together a PoC. These days, your chances are pretty good that it'll work right out of the box. It happens so fast it feels like magic, and the siren call of building more on top of it is irresistible. Maybe you come up with a few more feature, even get the LLM to plan them out before implementing them. But as you carry on things appear to slow down.

It took a single prompt to build your entire stack, but now it takes 3 or 4 just to get the nav links to work. Your page starts to take longer to load, and more you try to fix it, the more you end up losing traction and churning through the code you just generated. You can throw more intelligent models at the problem or bump up the reasoning level, but this just delays the problem rather than fix it.

It's called code churn, and it's a real phenomenon that existed long before LLMs did. It plagues junior and senior devs alike, but always to differing degrees.

So where did we go wrong exactly?

Funnily, it's more a matter of never doing it right to begin with. We took a proof of concept, what amounts to an "artist's impression", and tried to patchwork it into a functioning solution. We essentially built a house from the top-down, starting with the paint and plaster, and only later considering the walls and foundations. It sounds ridiculous, because it is. Working from the outside in only makes sense when you're designing, but if you intent to actually build the thing you're designing you need to take a step back and consider more than just the colors of the wallpaper.