📰 newsreader

hackernews score 2.09 好み 2.00 en

巨大なPRを送るのはやめてくれ:ある愚痴

原題: Stop sending me huge PRs; a rant

pull requestscode reviewartificial intelligenceai agentssoftware developmentcode maintainabilitydeveloper productivitycode documentation
原文 ↗

日本語訳

# 巨大なPRを送るのはやめてくれ:ある憤慨

もう、疲れ果てたよ。AIエージェントが「課題をワンショットで解決できた」からといって、1,000行、2,000行、3,000行もあるような巨大なPRをレビューするのは、もうこりごりだ。小さなPRが求められるのは、書く側が楽だからではない。常にレビュアーの利益のためなのだ。AIは業界にとって大きな恩恵だが、レビュアーやメンテナーにとっては負債になりつつある。私はただの時代遅れの老人が雲に向かって叫んでいるだけかもしれないが、お願いだから、巨大なPRを送るのはやめてくれ。

最近、「一括で変更しないと動かない」とか、「差分を全部入れないとコードが機能しない」といった主張を何度も耳にする。……ああ、そうだろうね? それで? 小さなPRの目的は、必ずしも小さくて個別の完成品を作ることではない。小さくて、消化しやすく、レビューしやすく、理解しやすい作業単位にすることなのだ。データがあるわけではないので、あくまで推測だが、コードを完全に理解するのにかかる時間は、行数に対して指数関数的に増加するのではないかと思う。一つの機能を丸ごとリリースしたいがために、私の時間を指数関数的に奪うのは、全く「喜び」を感じない。

ついでに言わせてもらえば、50行にも及ぶコメントも不要だ。もちろん、関数のドキュメント化はしてほしい。jsdoc、rustdoc、javadoc、そういった素晴らしいものは大歓迎だ。だが、「なぜ変数名を `is_logged_in` にしたのか」といった説明に5行も使うのは、絶対にやめてくれ。変数名が適切であれば、十中八九、何をするものかは理解できる。もし変数名が不適切でコメントが必要なら、もっとマシな変数名をつければいい。

最後に、「AIを使って理解(grok)すればいいじゃん」なんて言うAI信奉者たちへ。君たちは、AIが作ったコードをAIに再学習させて、トークンを無駄遣いしているだけだ。「レビューには別のモデルを使っている」だって? なるほど、素晴らしい。だったら、なぜそもそも人間によるレビューに回したんだ? その尊いAIに、我々のような凡人のためにPRを分割させ、我々がレビューし終えた後に、AIにレビューさせればいいじゃないか。

いいか、AIは素晴らしいツールだ。開発を加速させ、コードをより良くしてくれる。だが、Reactが登場したとき、「Reactは書くのが速くて読みやすいから」という理由で、より大きなPRを受け入れたわけではなかった。それなのに、なぜ今、同じことをしているんだ?

追記:途中で投げ出して、そのまま承認させるために巨大なPRを作っているのか? もしそうなら、お見事。実に見事だ。

原文(英語)を表示

I'm tired boss. I'm tired of reviewing one, two, three thousand line PRs because some agent was able to "one shot the whole issue." Small PRs were never asked for because they're easier to write, it's always been for the benefit of the reviewer. AI is such a boon to the industry, but it's becoming such a liability for reviewers and maintainers. Maybe I'm just an old man yelling at the clouds, but please, stop sending me huge PRs.

I have heard on multiple occasions recently the argument that "it won't work without the whole change" or "the code will do nothing if we don't put in the entire diff," well, yeah? Good? The point of small PRs is not necessarily to have small, individual, finished products. It's to have small, digestable, reviewable, understandable pieces of work. I have no data for this, so I will wildly speculate, that the time it takes to fully comprehend a piece of code increases exponentially with the number of lines the code covers. Taking up exponentially more of my time because you wanted to ship a full feature does not spark joy.

While we're at it, I don't need 50 line comments. Sure, document functions, give me jsdoc, rustdoc, javadoc, all of that good stuff. Absolutely do not give me 5 lines of comments on why a variable is named is_logged_in

. If your variable is named well, 9 times out of 10 I'll understand what it does. If your variable is not named well and you need a comment, name your variable better.

Finally, for you AI maximalists that say "just use AI to grok (not grok) it bro," you're wasting your tokens reingesting code that was already made by an AI. "I use a different model for reviews though," okay, great, why did you put it up for a human review at all then? Perhaps, you could have your precious AI separate it for us mere mortals and then review it after we've had our turn?

Look -- AI is a great tool, it really helps things move faster and can make code better, but when React came out we didn't accept larger PRs because "React is faster to write and easier to read," so why are we doing it now?

Addendum: are you just making giant PRs so I give up halfway through and approve it? If so, well played. Well. Played.

← 一覧に戻る