r/AskProgramming • • Sep 30 '26

Normal amount of lines for PR review

Hey guys, hoping to get some insight and opinions here.

As you all know with the boom of AI, people are vibe coding away which results in crazy amounts of code lines (newly added and removed). I'm just wondering what the general consensus is of what is acceptable to review, in one go by one person. Currently I'm staring at a PR with 3200 lines of newly added code. As of late, this is becoming the new norm whereas I was used to maybe a few hundred, MAYBE 1000. In another post, someone mentioned 0-500 was the norm prior to AI

What do you all think?

14 Upvotes

37 comments sorted by

2

u/omgseriouslynoway Sep 30 '26

Instant reject on the PR. Tell them to break it into features.

2

u/Tird_bandit Sep 30 '26

That's the direction I'm heading right now. I appreciate your input, glad I'm not totally out of line here

1

u/omgseriouslynoway Sep 30 '26

I felt so bad that they didn't have homes... but I made it up to them later lol

2

u/mredding Sep 30 '26

This is something to take up with your boss - how much time should any one PR take, and what's more important - PR reviews or writing code? What is the point of a PR here?

Because PRs were an opportunity for you to look over the implementation and glean the solution design, as well as look for oversights in the details. I expect a reviewer to understand the solution as the developer does, and can attest to every line. It also meant as a way of staying at least familiar with what the code across the project does.

But why even review AI generated code? How could it not be right? The AI can review itself. The AI can generate its own test cases (and what's the point of that if the AI is generating correct code?), the AI can generate the documentation and the change set.

Are you supposed to be checking for hallucinations? Or something? That sounds like an AI job. And YOU can't GET familiar with 3,200 LOC at a time, every time.

What you should then be doing is reviewing the prompts used to generate the solution to check for inclusiveness, scope, breadth, and oversights.

So you need to talk to the boss and ask what you're all doing here. ASK YOUR BOSS if he can pull the metrics and see just how long everyone is engaging in code reviews. Dollars to donuts - everyone is just hitting approve with almost no review whatsoever.

Overall, your shop has problems, and everyone needs to align on what you're all doing there.

2

u/Tird_bandit Sep 30 '26

Yup, I did bring it up to my superior and he basically said reject it, send it back, and tell them to break it into smaller pieces. Up until now when I run into these, I pulled down PRs and test the logic to make sure it builds, nothing explodes, and run a couple of things. Prior to these big PRs, I was still pulling down but I was at least able to focus on what was actually being written

1

u/mredding Sep 30 '26

I like his idea - it's kind of what I would do. I won't review AI generated code. No point.

9

u/PatchyWhiskers Sep 30 '26

Humans simply cannot review that much code. If you expect them to it will just result in them clicking "approve" without doing more than skimming, because if you spend all day reviewing 1 PR you are going to get PIPed.

Most companies doing this sort of PR review with AI, which seems to me to defeat the purpose. Might as well YOLO it.

1

u/kilkil Oct 01 '26

to be sure, having adversarial AI review will probably be helpful for catching some things.

however, IMO the time & place for that is for the author to get the agents to do that, themselves, before the PR is raised.

should be part of the whole "self-review before opening PR" thing, to save reviewers' time

and it any case, it definitely cannot replace human review. but I'm guessing these kinds of orgs are blind to that, or don't give a fuck

1

u/PatchyWhiskers Oct 01 '26

I don't see the point of a PR process for a fully vibe-coded app. If it's more than a person can review, they will just click "approve". If an AI approves it, do it as part of the process, as you describe.

PRs are for humans to collaborate with humans, catching human errors. Getting AI to do them is like a '90s boss requiring all e-mail to be printed out and filed.

1

u/kilkil Oct 02 '26

100% agree

-6

u/First-Tutor-5454 Sep 30 '26

it doesn't defeat the purpose. Having multiple agents running different models review a PR and drive toward consensus is a great way to use AI.

6

u/generally_unsuitable Sep 30 '26

You let your AI review your AI?

Do also let your junior devs review each other?

-8

u/First-Tutor-5454 Sep 30 '26

Of course we do. Not every single one, but my company is moving more in this direction each month and I think most of the industry is. You may be behind the curve, and that's ok. You will get there eventually.

7

u/generally_unsuitable Sep 30 '26

Are you speaking to me in a patronizing tone because I know how to actually do my job? Seriously, you can get all the way fucked.

8

u/PatchyWhiskers Sep 30 '26

Junior devs reviewing each other works better than one LLM reviewing another, because most LLMs produce extremely similar results, having been trained on the same data.

And a second LLM won't catch "culture" stuff like "The boss specifically told us not to do this again because of the problems it caused last time" (you can put it in the .md files but I find that the AI starts ignoring details if they are excessively large)

-5

u/First-Tutor-5454 Sep 30 '26

I answered you in the tone in which you decided to address me when I was replying to someone else.

What if anything is the substantive disagreement here? Do you really think that the best models in September 2026 operate at the level of a junior? Is it your position that the industry is not actually moving in the direction of AI assistance at every step in the SDLC? Do you think that human review will (can) scale with the rate at which bots are writing the code?

From what I gather, you think AI is incapable of doing what I see it doing more everyday, and you think it's still your job to be the last line of defense. I'm happy to agree to disagree, but more importantly I don't think either of our opinions matters at this point.

8

u/generally_unsuitable Sep 30 '26

I think that companies that rely on AI to PR AI are asking for trouble, and when they get they trouble they're asking for, they're just going to shrug and blame the AI for it.

You're taking the smartest people, training them to be data-entry clerks, taking them out of the safety chain, replacing them with systems that you don't understand, and you're expecting good results because "everybody else is doing it."

Do i think I'm the "last line of defense"?

Well, shit, if I worked at your company, I'd be the only line of defense. The rest is just LLMs clusterfucking code into your main branch. In two year's time, you guys will have a codebase that you can't even fucking read anymore.

It's Wall-E happening 100 times as fast as predicted, and you're all terrified to stand up to it.

7

u/foonek Sep 30 '26 edited Sep 30 '26

The idea with these people is that it doesn't matter if it's readable to us humans anymore, since only AI will be reading it and working in it. Only time will tell if that ends up being the case. Right now, at least, AI is not good enough for that to be the case. If it ends up never being the case, these companies will need to spend a lot of resources on fixing their software to make it workable again for developers

5

u/PatchyWhiskers Sep 30 '26

Don't really need the PR formalities for that. That's just a way of organizing human minds to work together. Agents can review work without going through that.

6

u/Any_Sense_2263 Sep 30 '26

300-500 lines of changed code. If there is even one more, I simply don't review. If human approval is needed, the PR must be fully readable by humans.

11

u/ForTheBread Sep 30 '26 edited Sep 30 '26

To me its more an issue with the ticket at that point. If the ticket requires that many changes its probabaly not broken down enough.

PRs on my team are usually no more than a couple hundred and most of that is just changes to the agent documentation/exec plans.

4

u/aleques-itj Sep 30 '26

I just try to go by "do one thing, and do it well" 

If your PR is legitimately just solving what it set out to do, so be it (within reason, that means what you're trying to solve shouldn't be something that rewrites half the app).

If you pulled in a bunch of shit that's technically unrelated because "eh, it was right there and I needed to fix it too anyway" then that's less defensible 

4

u/Ok_For_Free Sep 30 '26

I a fan of making refactor PRs separate from functional changes. If I'm going to review agent code myself, I'd ask it to do the same.

1

u/Doug2825 Sep 30 '26

Depends in how it is organized. 

A PR that is 3200 lines total but broken up into commits that are 100 lines is fine. A PR that is one 3200 line mega commit is unacceptable.

1

u/Tird_bandit Sep 30 '26

Yeah it was one big ass 3200 liner, not even multiple commits. All of the annotations and notes next to the logic indicates this was clearly AI generated because in my 8 years I have never seen that many comments

1

u/itemluminouswadison Sep 30 '26

yeah 1-300 wasn't too brutal. at 1000+ you're mainly leaning on tests being written and passing and stupid stuff like no harded coded tokens, or general pattern stuff (bro you have 999 magic strings learn what an enum/const is please and try again)

1

u/Crazy-Smile-4929 Sep 30 '26

Look. Back in my day that was more the norm with Java. You got used to skipping over the parts that were more boilerplate and focus on the actual logic. So number of lines wasn't something that mattered too much.

These days, with or without AI, I aim for 1000 for what I give to others. No problems reviewing that or higher myself.

I don't think there's a real right answer to this one. Sometimes you just can't break up a change that much while still keeping enough context in it

1

u/babysealpoutine Sep 30 '26

Too big. Ask them to break it up into smaller chunks that build on each other. 3200 lines for a completely new feature?

I'd recommend they break that down into smaller pieces (see elephant carpaccio). If they have a high-level design as the end goal, they can also include a reference to it so reviewers can see what they're building toward.

Yeah, it's certainly easier to let AI crank out large amounts of code, but at the end of the day, the team is responsible for it, so it still needs some level of trusted review.

1

u/HealyUnit Oct 08 '26

Number of lines is not really ever a good metric of anything when it comes to coding. For example, for the project I work on, we're running an architecture with a lot of microservices. Each of those microservices has its own Kubernetes config files, but in a lot of places those config files are almost or nearly identical. So let's say I updated those config files all from something like maxMemory: 16GB to maxMemory: 64GB. In this case, a dev who doesn't wanna waste time (and all devs want to not waste time!) might just do a find-replace. So even if I'm replacing this same line in 150 different files, it's pretty easy to see that this is just one change. Even if I were replacing 100 lines in each of those 150 files (15k lines total)*, if it's abundantly clear that the change is just a copy-paste in each file, then it'd actually make more sense to do this all in one PR than arbitrarily saying something like "let's do the first 2000 randomly-picked services in this one PR, and then the next 2000, and so on".

Instead, what I'd focus on are atomic changes. Is the "purpose" of your PR something that can be reasonably** broken down into further sub-tasks? If so, it's not atomic. For example, let's say you wanna add a username/password login form to your web app. Your tasks might be:

  • Add UI box with username field, password field, and login button. They should be "dead" (not do anything)
  • Add a front-end user manager whose sole purpose is to pass the username and password back to the back-end.
  • Add a backend service that takes the incoming username and password and checks them, assigning the status of "logged in" if appropriate

Your first task here would be to only add UI code to present a login interface to the user. If the PR from this does more than that, reject it: it's over-stuffed.

* Of course, I'm ignoring the fact that it'd make more sense to have a central common config file here. Let's just ignore that.

**"reasonably" of course here is extremely nebulous. You could potentially have a series of PRs where each one adds or removes exactly one letter of code, and just never run a merge pipeline. Use your judgement here.

1

u/EntrepreneurHuge5008 Sep 30 '26

As of late, this is becoming the new norm whereas I was used to maybe a few hundred

The new norm is also that PRs are reviewed by AI, too.

But yes, for human review, keep it under 500. I even think 500 is too big a change.

1

u/First-Tutor-5454 Sep 30 '26

agreed, I would normally refuse to review a pr of more than 200 lines, maybe 300.

in my company we are moving towards AI review targeting most PRs by EoY, with AI determining if a human should be involved