One Month Without AI

One Month Without AI

离开 AI 的一个月

Several months ago, I decided that AI contributions were no longer welcome in a FOSS project I am building and maintaining - LibreWeddingPlanner. It’s not that it got a lot of contributions with AI — actually all contributions I’ve had are translations and feature requests — but I wanted to avoid future drama and have a position against AI. 几个月前,我决定在我开发并维护的开源项目 LibreWeddingPlanner 中不再欢迎 AI 贡献。这并不是因为该项目收到了大量 AI 生成的贡献(实际上我收到的所有贡献都是翻译和功能请求),而是因为我想避免未来的麻烦,并表明我对 AI 的立场。

However, although I was not using AI for my FOSS contributions, I kept using it at work. In my workplace, as well as in many of my developer friends’, using AI to work is very, very common. Not without a degree of shame, let me tell you about this experience, and how it was turning me dumber, lazy, and a worse developer. 然而,尽管我在开源项目中不用 AI,但在工作中我却一直在使用它。在我的工作场所,以及我许多开发者的朋友那里,使用 AI 工作已经非常非常普遍了。带着些许羞愧,我想和大家分享这段经历,以及它是如何让我变得更笨、更懒,并成为一名更糟糕的开发者的。

The sweet start

甜蜜的开端

A friend told me hey, you should try it, you feel so powerful. Once you start using it, you cannot stop. The tasks that took you days, you can have them in hours. No, we’re not talking about cocaine, although to some degree I consider the use of AI, an addiction. I started enabling the enhanced autocomplete in vscode (or was it enabled automatically?), and downloading and using other code generation models just followed. 一位朋友告诉我:“嘿,你应该试试,你会感觉自己非常强大。”一旦你开始使用,就停不下来了。原本需要几天完成的任务,现在几个小时就能搞定。不,我们谈论的不是可卡因,尽管在某种程度上,我认为使用 AI 是一种成瘾行为。我开始在 VS Code 中启用增强型自动补全(或者它是自动启用的?),随后便顺理成章地下载并使用了其他代码生成模型。

When I was a child, I remember my parents saying be careful with the bad guys who offer candies at the school gate, those are not candies, those are drugs. When I was in my twenties, I’d pull their leg saying yeah, it’s like they give away the drugs now hum? Well, in my thirties I think they may very well do. Once you start using AI coding agents, things spiral out of control very quickly. 小时候,我记得父母告诫我,要小心校门口那些给糖果的坏人,那不是糖果,那是毒品。二十多岁时,我会开玩笑说:“是啊,现在他们真的在免费发毒品了,对吧?”到了三十多岁,我觉得他们可能真的会这么做。一旦你开始使用 AI 编程代理,事情很快就会失控。

At the start, you ask AI to implement a function for you, or to write tests for a certain piece of code. If you’ve been a TDD guy for a long time, you’re inclined to ask it to do the tests for you first, so that you can later write the code. Except you don’t write the code anymore, you just ask AI to do it, and half of the purpose of TDD (not biasing the tests by how you’ve implemented the code) is gone. But you feel you go so fast that you start not caring. One day, I saw the agent was co-signing the commits I was making, and I ran to opt-out from that setting. Like, I wanted to pretend the code was my own. Gosh. 起初,你只是让 AI 为你实现一个函数,或者为某段代码编写测试。如果你长期习惯于 TDD(测试驱动开发),你倾向于先让它写测试,然后再自己写代码。但问题是,你不再自己写代码了,你只是让 AI 去做,而 TDD 的一半目的(即不因代码实现方式而产生测试偏差)也就随之消失了。但你感觉自己进展神速,于是开始不在乎这些了。有一天,我发现代理程序在共同签署我的提交记录,我赶紧跑去关闭了这个设置。就好像,我想假装这些代码是我自己写的一样。天哪。

Losing control

失去控制

It would not be so bad if things had stopped there, but that’s not how most human brains work. If you like something and you can have 2x, you’ll have it. I started pasting the whole Jira description of a ticket, and let AI implement it for me. Yay!! So powerful!! Working on a codebase that was relatively new to me, I started losing control over which changes were really needed to fulfill the task. I thought if the AI, which has read every line of code in the project says it’s needed, so be it. Control is an illusion. 如果事情到此为止倒也还好,但人类大脑的运作方式并非如此。如果你喜欢某样东西,并且能得到双倍,你就会去争取。我开始把整个 Jira 工单描述粘贴进去,让 AI 为我实现它。耶!!太强大了!!在一个对我来说相对陌生的代码库中工作时,我开始失去对“哪些更改是完成任务真正必需的”这一判断的控制。我想,既然 AI 已经读过项目中的每一行代码,它说需要,那就这样吧。控制力只是一种幻觉。

Other folks I’ve discussed this with agree that they don’t know 100% of what the code they are pushing to production actually does. I bet we not even 20%. Fucking scary. But it also didn’t stop there. When I had a small task, I gave it to the AI, and in ~30 minutes I had a PR. What was I doing during those 30 minutes? Changing focus. Soon I realized I could have not one, but multiple agents working on different tasks simultaneously, in multiple git worktrees. Full power! Tokenmaxxing! 我和其他讨论过这个问题的人都同意,他们并不完全了解自己推送到生产环境的代码到底在做什么。我敢打赌,我们甚至连 20% 都不了解。真他妈可怕。但事情还没完。当有一个小任务时,我把它交给 AI,大约 30 分钟后我就得到了一个 PR(合并请求)。那 30 分钟我在做什么?在切换注意力。很快我意识到,我不仅可以拥有一个,还可以让多个代理在多个 git 工作树中同时处理不同的任务。全功率!Token 最大化!

I connected the agents to Jira via ACLI (command-line interface) and just asked them “work on this jira ticket in a separate worktree”. And it would start working on it. I felt ecstatic. When the task was not so small, you’d think I was working on it myself right? Hell, no. I would of course ask AI to decompose it into smaller tasks, and work on them. AI would then give me a super convincing PR with a bunch of changes I didn’t quite understand. How on Earth was I going to ask for a code review of those changes? What would my peers say? What was I going to say when they (more experienced, specially in that codebase) ask me why I did this or that? How was I going to admit it was all AI, and I was nothing but an AI shepherd? 我通过 ACLI(命令行界面)将代理连接到 Jira,然后直接告诉它们:“在独立的工作树中处理这个 Jira 工单”。它就开始工作了。我感到欣喜若狂。当任务没那么小时,你以为我会自己动手吗?见鬼,不。我当然会要求 AI 将其拆解为更小的任务,然后去执行。AI 随后会给我一个非常有说服力的 PR,里面包含了一堆我不太理解的更改。我到底该怎么请求别人对这些更改进行代码审查?我的同事会怎么说?当他们(尤其是那些在该代码库中经验更丰富的人)问我为什么这么做时,我该怎么回答?我该如何承认这一切都是 AI 做的,而我只不过是一个 AI 牧羊人?

So I forced myself to understand the code. Not that I wanted to understand the architecture of the codebase, I wanted to avoid the humiliation of not knowing what the fuck I was doing. At some point, I had so many AI agents working, that the focus change was too much for me. There were tasks I could have done in 20 minutes easily, that took 5 minutes of an AI agent, and then 2 days for me to review. Because there were so many other things. And maybe AI and computers are good at context switching, but not me. I was exhausted. 所以我强迫自己去理解代码。并不是我想理解代码库的架构,我只是想避免那种“不知道自己到底在干什么”的羞辱感。在某个阶段,我同时运行了太多的 AI 代理,以至于注意力切换让我不堪重负。有些我本可以轻松在 20 分钟内完成的任务,AI 代理只需 5 分钟,但我却要花 2 天时间去审查。因为还有太多其他事情。也许 AI 和计算机擅长上下文切换,但我不是。我精疲力竭。

Because if it was just about approving PRs that are perfectly written, it would be good. But for each PR I had to look at the code, the tests, the style, give feedback, switch to something else, go back again, push, see if I have any PR comments, if CI passed, wait, now the linter complains. And it takes you 2 days to deliver something that could have been literally 1 hour single-focused. In my personal experience, multiplied AI performance is just an illusion. Multiplied frustration and exhaustion is guaranteed, though. 如果只是批准那些写得完美的 PR,那倒还好。但对于每一个 PR,我都必须查看代码、测试、风格,给出反馈,切换到别的事情,再回来,推送,看看有没有 PR 评论,CI 是否通过,等等,现在 linter 又报错了。原本专注一小时就能完成的事情,现在却要花两天时间。根据我的个人经验,AI 带来的性能倍增只是幻觉,但挫败感和疲惫感的倍增却是实打实的。

I think there was not a single task I gave to the AI that I could merge as is. Of course, I didn’t write the commits or the PR descriptions myself (what is this, 2024??), AI was doing it for me, and it made sure there was a 7-paragraph description in the PR, explaining what it had done. I stopped reading those descriptions, like, I told it what to do, I assume it did what I said. The description is for others. Because there has to be a description, right? AI is so fucking good as sounding professional, that you relax and let it be. It’s not that I actually thought the code was good, but you get convinced over time, you get lazy, you become complacent. You stop questioning, and start accepting as good some code you would have never accepted, just because you cannot tell why it’s bad. You have lost control. Most AI developers will deny it, but deep inside, they know it’s true. Just don’t want to face it. Months passed by, and one day I realized I had not written a single line of code myself in several months. I didn’t even commit myself. Countless… 我认为我交给 AI 的任务中,没有一个是可以直接合并的。当然,我没有自己写提交信息或 PR 描述(这都 2024 年了,谁还自己写?),AI 代劳了,它确保 PR 里有 7 段描述来解释它做了什么。我不再阅读那些描述,就像是,我告诉它做什么,我就假设它做了我说的。描述是给别人看的。因为总得有个描述,对吧?AI 在听起来专业这方面简直太他妈厉害了,以至于你放松警惕,任由它去。并不是我真的觉得代码写得好,而是随着时间推移,你被说服了,你变懒了,你变得自满。你停止了质疑,开始接受那些你本绝不会接受的代码,仅仅因为你无法说出它哪里不好。你已经失去了控制。大多数 AI 开发者会否认这一点,但内心深处,他们知道这是事实。只是不想面对罢了。几个月过去了,有一天我意识到,我已经好几个月没自己写过一行代码了。我甚至连提交记录都没自己写过。无数……