• Ledivin@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    13 days ago

    Why is Claude writing code that I’m supposed to read?

    I wasn’t going to read it line-by-line. I’d skim it, run the tests. So why make AI write in a format optimized for human readers who aren’t reading?

    If you aren’t reading your LLM’s code line-by-line, you’re a fucking moron and deserve the AI hate.

    • rollin@piefed.social
      link
      fedilink
      English
      arrow-up
      1
      ·
      13 days ago

      Hmm it’s an interesting thought. If you’re satisfied with your tests - with their coverage and their rigor - then really there shouldn’t be a need to read code.

        • rollin@piefed.social
          link
          fedilink
          English
          arrow-up
          2
          ·
          13 days ago

          The code for the tests, yeah. But not the code for the app itself. If you’ve written tests that you are satisfied fully cover all requirements including edge cases, you can satisfy yourself that the app does what you want it to without looking at the app code.

          Test-driven development but with an LLM doing the actual development.

          • That doesn’t work. TTD works because you’re writing the code you’re testing, so you know exactly what’s in there.

            If the LLM hallucinates a feature that wasn’t in the requirements and is somewhat hidden, reviewing the tests won’t cut it. The tests may cover all the requirements, but what about all the code doing stuff that’s not required?

            Basically, don’t just test for requirements, also test that what isn’t required isn’t there. And that’s basically an infinite amount of possibilities to test for. The only way you detect that stuff is by checking that the code isn’t doing anything extra it shouldn’t be doing.

  • schnurrito
    link
    fedilink
    English
    arrow-up
    5
    ·
    13 days ago

    really, the first? I think Brainfuck was also not built for humans and has been around for a while…

    (this apart from the other obvious things to write about this idea…)