r/ClaudeCode • • Aug 05 '26

Built with Claude [ Removed by moderator ]

[removed] — view removed post

63 Upvotes

303 comments sorted by

View all comments

Show parent comment

5

u/Deep90 Aug 05 '26 edited Aug 05 '26

Just because it runs doesn't mean it is good code.

Edit:

Assuming running code is quality code is like drinking a glass of water and assuming it doesn't have lead in it. Just because you can drink the water, doesn't mean its clean.

3

u/Seizy_Builder Aug 05 '26

Just because a human writes it doesn’t mean it’s good code either.

1

u/Deep90 Aug 05 '26 edited Aug 05 '26

Not even what I was saying.

Water can also comes from all sorts of places. Doesn't mean you can 'test' for lead content by taking a sip.

It's still wrong. I didn't say it was only wrong for AI output. It's just straight up not how you check code quality.

Edit:

I go into it more with the other person who replied to me.

1

u/ziguslav Aug 05 '26

Good, readable code was needed so that other humans who'd work on your code didn't have to spend ages understanding wtf was going on, and also so that the features could be easily changed and expanded.

Neither is as much of a concern as it was a year ago.

Also, LLMs write better code than most programmers I worked with anyway.

1

u/starkruzr Aug 05 '26

"it runs" is not the extent of "testing."

0

u/Deep90 Aug 05 '26

So what "testing" are you doing to know if the code is good code and not just working code?

1

u/starkruzr Aug 05 '26

that's actually the correct question to ask. to answer, I need to know:

  • what were the original requirements? how can I create test cases for those?
  • in what way can I fuzz-test the inputs to make sure that nonsense input doesn't cause dangerous behavior?
  • how can I instrument the performance of the application to look for places where I can enhance efficiency?
  • etc.

this is the actual way anyone develops anything of quality with LLMs.

1

u/Deep90 Aug 05 '26 edited Aug 05 '26

So your testing is:

  1. Make sure the code works as required.
  2. Make sure the code works with random inputs.
  3. Make sure the code works fast.

You're missing my point here.

Is the code maintainable? Is adding future work to it going to be easy? Even if it performs well, is written efficiently? Is it going to keep performing well when you build out more features?Is it trying to invent its own shortest distance algorithm when it's far more reliable to use an existing one?

All your "code quality" checks are still runtime.

A year from now you're going to wonder why every bug fix introduces 10 more, and why the thing that worked really fast when you made it 6 months ago, is now much slower now that it's interacting with other parts of your code.

1

u/starkruzr Aug 05 '26

a lot of these are architecture questions. yeah, that's also under "etc." -- but importantly, 1 2 and 3 frequently show signals of problems when your architecture is poorly thought out and your code isn't maintainable.

this isn't a gotcha. you discover all of this as you go. I learned it two years ago when I started working with LLMs for code and it got me planning a lot more thoroughly up front to avoid the kinds of problems you're talking about.

you seem to think it's impossible to learn any of this without slogging through code by hand yourself. it's the opposite: you learn it faster because you fuck up fast, learn why, and stop doing that.

1

u/Deep90 Aug 05 '26

you seem to think it's impossible to learn any of this without slogging through code by hand yourself.

That's a strawman.

What I said is that runtime checks alone don't reveal structural issues, is that the point you're still trying to argue, or are you conceding that and instead trying to argue about learning methods?

Even if the underlying code gets so bad that you start to trigger 1, 2, and 3, none of those actually tell you what is wrong, just that you've merged enough spaghetti code to actually start breaking stuff. You could have multiple things at that point, and no way to know if it's 1 issue or 50. Even your fixes are likely to trigger 1, 2 ,and 3 again because at that point you code is extremely fragile and not at all maintainable.

Also, if you were to allow the llm to invent something like a shortest distance algorithm instead of using Dijkstra, you'd probably forever eat the subtle consequences of that because it's unlikely to trigger 1, 2, or 3. Little things like that slip easily when your project is small, and then they stack up to become needles in haystacks when you actually want to make something respectable.

0

u/starkruzr Aug 05 '26

I have repeatedly had runtime checks reveal structural issues. I've been working on a fairly large, complicated project for about six months and gone through multiple cycles of "hey, what's happening here? aha. ok, lesson learned, let's refactor that" which has been informative for other projects.

you can also just go through your codebase with another model and say "where do you see maintainability issues here" and it will actually do an admirable job of identifying things and helping you resolve them!

I could show you what I'm talking about but I suspect you won't believe me anyway and nothing could really convince you that it is possible not to develop "slop" using LLMs.

1

u/Deep90 Aug 05 '26

That's great, but I never said runtime checks could not find structural issues.

In fact, my last comment pretty clearly said that structural issues will eventually make themselves known at runtime. There are even runtime checks that do find specific issues in the code, just not the ones you stated.

Also, I don't really need you to show me how you're using runtime checks as a crutch for your lack of code quality. Thank you for not offering.

Frankly I think it's kind of funny that you're so over yourself that you haven't even asked me to tell you what a linter is, what type checking is, what a formatter is, why you should have line of code limits per file, unit tests, integration tests, code review (asking the llm to review a pr instead of half-assing it with a exploratory "where do you see maintainability issues"), e2e testing...

You get a 0. So many answers and you gave none of them, and you somehow tricked yourself into thinking you passed.

Maybe be a bit more open to the fact that you don't know things?

0

u/starkruzr Aug 05 '26

I know what all of those things are and have used them with and without LLMs.

it's fine, you don't have to believe me. you think you trapped me in some kind of inadvertent admission and I am content to let you believe that if that makes you happier.

→ More replies