← Back to context

Comment by aidos

1 day ago

Yesterday my 8yo prompted (using voice recognition) Claude to make a game where it would play her a song (say Twinkle) and she had to play it back and get scored. The UI was a nice piano with visual feedback. The laptop key served as the keys until I prompted for midi support so she could use the electric piano. The whole thing took about 15 minutes.

Meanwhile, one peak at the code and you can already see the state starting to become a bit of a spaghetti mess.

It’s a funny time to live through. A lot of code is being written and a lot of it is going to be a real future burden.

> A lot of code is being written and a lot of it is going to be a real future burden.

This assumes that the models of the future won't find it easier to just throw the code away and rebuild it

This also assumes that the same application build by humans wouldn't become a "spaghetti mess".

  • Reminds me of Niven/Pournelle's "The Mote in God’s Eye" where the aliens have a very pragmatic/Jury-rigged approach to technology and everything is more or less improvised.

    I have noticed this with co-workers also, when you have the ability to read/write/understand things very quickly, you tend to spend much less time on making things tidy, clear and maintainable.

    • But then you end up in a state, 2 years down the line, where every single person that works in that code base haaaates it and adding any new functionality takes weeks or months.

      Compare that to clean, organized code where patterns and extensibility are established. I’ve seen product manager surprised at how fast a new feature was added when everything is laid out well.

      3 replies →

  • You use an AI to make the spaghetti.

    You use another AI to document the spaghetti.

    You use the third AI to make a spicy meatball from the spec.

  • >just throw the code away and rebuild it

    What about all the undocumented "adjustments" ("bug fixes" in a professional context) that were made to make it actually useful?

  • > This also assumes that the same application build by humans wouldn't become a "spaghetti mess".

    nah, it reflects on how applications built by humans usually do become spaghetti messes with all the resulting brittleness and unintended negative side effects of changes that result

    but it probably doesn't matter for a little toy piano app

  • And the models of the future will surely be better than they are today. This stuff is still a very long way from maturity.

    Sometimes it seems like they're moving very slowly. That makes sense: It's easy to get used to how they work today and it is also easy to forget how much worse they were last year.

    When we look back and realize that just 4 years ago these tools didn't really exist at all, it becomes clear that the rate of progress is rather amazing.

    In 4 years, we've gone from "hah, good luck with that crap!" to "little kids writing music-learning games on their own in a few minutes"

    That's pretty friggin' awesome, and it's not finished yet. :)

    • > And the models of the future will surely be better than they are today. This stuff is still a very long way from maturity.

      Since this is Claude, the models of the future might be more expensive, or more locked down, or might decide your 8yo is actually trying to build a cleverly disguised bomb so her request gets silently downgraded to a dumber model, etc.

      14 replies →

  • I think that sort of careless waste is a very human behavioral pattern, but then we are the ones training these bots.

    ed sp

  • Eh, not really. It's the same issue with porting. You always rely on features you didn't properly articulate.

  • AI writes faster, so the rate it incurs tech debt is proportionally higher. However it's ability to have large context kept on memory compared to humans is also a key component fighting against it. These are occasionally forgotten when code quality of AI for large code bases are discussed. So Yes I think humans also build spaghetti, but as they write slower they get to the same place a lot later. However humans can't correct it, or can't correct it fast enough. AI can.

    • It does somewhat depend on the application size. Seems to me that for regular software projects (that aren't enterprise SaaS) a good programmer will create better software than Claude. Maybe the dehumanizing way to say it is that humans have more efficient/improved retrieval. The amount of time I see repeat code for no reason, or code/context that has been obviously missed is absurd.

  • I agree with this. Clean code is important today because it helps humans to understand it. Cleanliness is not otherwise intrinsically valuable.

    Today I don't always need to understand the code. When I do, I can ask the LLM to explain the code or to specify the algorithm in pseudocode or even re-write the code until I can understand it.

    I think, as an industry, we haven't yet fully grasped the impact of agentic coding. We don't yet know what software engineering is going to be like in 5 to 10 years.

I wonder. I remember before emissions, what's underneath a car hood was relatively organized and simple. Then with emissions it became a maze of vacuum hoses and so much other nonsense.

then ... in some places (maybe cars that people care about working on) it became cleaner again. In the other places, they added a second hood to hide the mess.

There is some clean code out there, like maybe the seL4 kernel:

https://github.com/seL4/seL4/

https://en.wikipedia.org/wiki/SeL4

"with an explicit goal of enabling comprehensive formal verification..." (and lots more stuff)

maybe we can still have niches like this.

  • That's what happens with scale...

    The purpose of a car itself didn't change. But the massive inflated demand, as our city planners decided every adult must be put in a rolling metal cage to participate in society, changed the environment it was originally designed for.

    Now it's a matter of geopolitical stability, or even basic human habitability of these spaces, that a car converts as much of that chemical energy into movement, and releases as little toxic byproducts in the process. Whereas before, that cost, at scale, was small enough to neglect.

    Just like a modern CPU evolved into an incomprehensible mess, even though the basic consumer needs hadn't changed much, because the politics of computing forced them to run expanding institutional cruft at reasonable speeds, on battery-powered always-on addiction machines.

  • > then ... in some places (maybe cars that people care about working on) it became cleaner again

    Those cleaner looking engine bays are usually worse to work on. Not better.

    When you open up the hood and immediately see lines everywhere, that also means they’re within reach. This is great.

    The engine bays that look nice and clean for the showroom still have those same lines. They’re just buried in there. If you need to work on them you’re going to be reaching underneath things, climbing under the car, or even removing other parts to access something simple.

    Also, it’s not all about emissions. A lot of those lines are for modern comforts like cruise control and improvements like features that make cold starts easier or make the engine behave better at extreme temperatures. Some of those have been superseded by electronically controlled versions which is why some of those lines are disappearing on modern cars, but the overall complexity has increased further.

  • It was simple because it was inefficient and archaic. Reducing pollution is not "nonsense"

    • Not criticizing function, criticizing elegance of the solution. Eventually with time elegance was achieved again.

      another analogy would be opening some computers to add memory/ssd/hd, as judged by ifixit

      3 replies →

  • I think the vacuum hoses are actually for the brake booster and why you don't have any regular brakes if your engine dies. But yes, smaller engine + turbo or twin turbo is definitely more complex than a simple big block. There's also an absolute shit ton more sensors on everything now.

> Meanwhile, one peak at the code and you can already see the state starting to become a bit of a spaghetti mess.

That is how compiler-generated assembly looks to humans, as well. Human-produced is typically much more readable. Yet, here we are. Most programmers only know the very basics of assembly programming, but the world keeps spinning just fine.

  • Comparing LLM output to compiler output is such a stale meme by now that it's surprising to see people still saying it. Obviously a deterministic translation of a higher level programming language to machine code is different than the slop cannon.

    • 1. Compilation has typically not been deterministic. Even within the same exact compiler tool chain version.

      2. Compilers and building tool chains change all the time. CI and automated testing catch any regressions. Tye same can be done with LLMs.

      3. LLM code generation, with some work, can be made deterministic, if that mattered to somebody.

      5 replies →

In what world would this be a future burden? It's just a throwaway fun project lol

  • Suppose she decides from the experience that she likes making games, and wants to expand on it. She wants to support more songs, different types of song sources, colorful animated backgrounds, flashy graphics, change how it scores, a hundred other things. But by the time she gets halfway through it claude just starts getting things wrong and making them worse, and it turns into a nightmare where she doesn't even know how to go back and going back doesn't fix the problem. Or going back undoes some things she did want along with all the stuff it broke, and now she has to do it all over again. She makes a change on one screen and it changes the behavior on a dozen others. Claude starts telling her that things are impossible, or that it did this because there was a comment that said she wanted it, or coming up with other weird complicated reasons, citing random lines of code, why this or that can't work. And then she decides that yeah, making things is an awful experience and she never wants to do it again.

    • You could just teach her some real project management skills. Show her how to put together documents and code hygiene rules. Setup some CI/CD pipelines and have sub-agents that can review the code as it gets generated. Introduce her to test driven development.

      1 reply →

  • You mean the 8 year old shouldn't be thinking about how she will maintain this code when she's 15? This generation is lost.

Picking over the theoretical maintainability of one-off tools and toys that were generated in minutes by what will soon be an outdated model, feels very...missing the forest for the trees, when it comes to speculating about the future impact of this stuff.

>Meanwhile, one peak at the code and you can already see the state starting to become a bit of a spaghetti mess

I honestly think people on here are very much overstating 'spaghetti code' when AI does it... first, it works correct? The reason I say that if the AI can continue to upgrade code that might not always look 'the prettiest' (to you..) because it doesn't care about what some of us consider to look like clean code. If it can continue to manage, document, and upgrade the code successfully.. does you calling it spaghetti code actually matter? Maybe you have a hard time reading it but the AI certainly doesn't.. I think that's worth consideration.

Every one of us has our own conventions and ideas of what 'clean' code looks like sometimes. And honestly 95% of the time we only thing it's clean if we wrote it ourselves.

> Meanwhile, one peak at the code and you can already see the state starting to become a bit of a spaghetti mess.

So it's on par with humans, then.

The job of code like this is going to serve as a makeshift spec for future coding agents, so they extract the intended use and redo it on command. Better models will be able to improve the actual code until you hit some diminishing returns for the problem you've solved.

Yes but it’s far better than anything anyone, let alone a small child, could make in 15 minutes

On the other hand an engineer might take a couple hours and build this in a clean way with the right prompting

These “got ‘em” ai criticism comments are getting so old

  • I wasn’t trying to make a “got em” comment.

    The fact that this is possible and works at all is mind blowing - even more mind blowing is that my 8 yo is growing up in a world where they can talk to a machine to produce a custom application in seconds and they don’t realise how mind blowing it is!

    In terms of the code, it would take even less time than that to tidy it up. For this application you wouldn’t bother. That’s almost a form of “premature optimisation” unless you’re actually planning on doing more work on it.

    My hunch is that what the world is about to see a lot of is much bigger bits of work, or changes to other bigger existing systems done by people without the skills to know how to contain the complexity. That’s going to come with a burden.

  • The only reason it's a spaghetti mess is because it's not being prompted correctly by an expert.

    • Are these experts in the room with us right now? Because if even the creators of Claude seemingly can't prompt non spaghetti code (see: Claude Code leak), I'd like to know who can.

      7 replies →

    • 100%

      A novice writing code by hand could also write spaghetti code

      If you've worked in enterprise software, you might have seen that even competent professionals can write spaghetti code

      At this point AI really is just garbage in garbage out

      2 replies →

>Meanwhile, one peak at the code and you can already see the state starting to become a bit of a spaghetti mess.

What does this even mean? Does the software run? Did you plan on extending it? Maybe turning it into a "platform"?

Why doesn't HackerNews understand software exists to solve a problem? No one cares if code is pretty if it does the job. You can talk about "potential issues" until you're blue in the face. It doesn't matter.

  • It's not about prettiness. It's about being harder to extend thus making future adaptations harder.

    • You don't always need to extend or adapt. Not every piece of software is a business. Most often it's a tool to achieve something else.

      Besides, this all revolves around the, I believe false, premise that humans write code better than AI.