Learning Programming in an Age of LLMs

Learning Programming in an Age of LLMs

在大语言模型(LLM)时代学习编程

On learning programming in an age of LLMs by Mark Seemann. Open answers to a reader’s letter. A reader recently wrote me a long letter with lots of questions about learning programming in this age of LLMs. After a bit of back-and-forth, I got permission to quote extensively from the letter in order to attempt some answers in public. None of my answers I consider particularly rigorous; the situation is so uncertain that I can only answer to the best of my abilities, but I don’t claim them to hold any kind of immutable truth.

本文探讨在大语言模型(LLM)时代如何学习编程,作者是 Mark Seemann。这是一封公开回复读者来信的文章。最近,一位读者给我写了一封长信,提出了许多关于在 LLM 时代学习编程的问题。经过一番沟通,我获得了对方的许可,可以引用信中的大量内容,以便公开尝试回答这些问题。我并不认为我的回答有多么严谨;目前的局势充满不确定性,我只能尽我所能去回答,并不声称这些观点代表了某种永恒的真理。

“I’m trying to understand how people who deeply understand software think about learning and competence in the age of AI. I’m approaching it almost as a historian would: asking people directly how they make sense of a technological transition while actually living through it.”

“我试图了解那些深刻理解软件的人,是如何看待人工智能时代的学习与能力的。我几乎是以历史学家的视角来处理这件事:直接询问人们在亲历技术转型时,是如何理解这一过程的。”

“About a year ago I became fascinated by AI-assisted programming. Despite having no formal CS background, with LLMs I managed to build a fairly large TypeScript/JavaScript system involving APIs, PostgreSQL, LLM pipelines, research automation and multi-model workflows. At first it felt almost magical: AI seemed to collapse the distance between having an idea and being able to build it.”

“大约一年前,我迷上了人工智能辅助编程。尽管没有计算机科学的专业背景,但在 LLM 的帮助下,我成功构建了一个相当庞大的 TypeScript/JavaScript 系统,涉及 API、PostgreSQL、LLM 流水线、研究自动化以及多模型工作流。起初,这感觉简直像魔法一样:AI 似乎消弭了从产生想法到将其实现之间的距离。”

“But now I’m trying to turn that system into a real production product, and I’m struggling. I fix one error with AI, then another appears, then another part behaves in a way I don’t fully understand. After months of refactoring I had an uncomfortable realization: I may have built a system that is above my own level of understanding. When everything works, that gap is almost invisible. When it doesn’t, it becomes very real.”

“但现在,当我试图将该系统转化为真正的生产级产品时,我遇到了困难。我用 AI 修复了一个错误,接着又出现另一个,然后又有其他部分表现出我无法完全理解的行为。经过几个月的重构,我产生了一种不安的认知:我可能构建了一个超出我自身理解能力的系统。当一切正常运行时,这种差距几乎是隐形的;但当它出问题时,这种差距就变得非常真实。”

“Sometimes I genuinely don’t know what to do next without asking another model. That made me wonder whether I spent a year building a product, or partly building the appearance of one: something sophisticated enough to work, but which I don’t yet understand deeply enough to truly own.”

“有时,如果不去问另一个模型,我真的不知道下一步该做什么。这让我怀疑,我这一年究竟是在构建一个产品,还是仅仅构建了一个产品的‘外壳’:它足够复杂以至于能运行,但我对它的理解还不够深,无法真正掌控它。”

“I’m not anti-AI at all. I’m fascinated by these systems and want to work with them professionally. But I’m unsure what the right relationship with them should be.”

“我一点也不反 AI。我被这些系统深深吸引,并希望在职业生涯中与它们共事。但我并不确定与它们之间正确的互动关系应该是怎样的。”

Indeed, I’m not sure either, but before proceeding, I find it most transparent to reveal my position. I haven’t yet decided on AI, but I lean toward disliking it, knowing full well that it may be unstoppable. I do work and experiment with it, and it often impresses me. At other times, it frustrates me. It’s usually when it impresses me the most that I resent it maximally. When it’s bad, it can be frustrating, but then at least I can absorb an ember of warmth in the illusion that what I’ve spent more than thirty years learning is still relevant. When it’s at its best, I sometimes think: Where do I sign up for the Butlerian jihad?

事实上,我也不确定。但在继续之前,我觉得开诚布公地表明我的立场最为透明。我还没有对 AI 下定论,但我倾向于不喜欢它,尽管我非常清楚它可能势不可挡。我确实在使用并尝试它,它经常让我感到惊艳,但有时又让我感到沮丧。通常,当它最让我惊艳时,也是我最反感它的时候。当它表现糟糕时,虽然令人沮丧,但至少我能从中获得一丝慰藉——因为这让我产生一种错觉,即我花了三十多年学习的知识依然有价值。而当它表现得最好时,我有时会想:我该去哪里报名参加“巴特勒圣战”(注:科幻小说《沙丘》中人类摧毁所有人工智能的运动)呢?

My position on LLMs is only partly based on my own socio-economic status. I’m old enough, and have had enough success already, that all other things being equal, I can survive unemployment. I’m not sure, on the other hand, than any knowledge-based society can. It may be that LLMs will take programmer jobs before they take other white-collar jobs. After all, programming may be a discipline where verification is easier than, say, insurance claims management. Still, if we reach a point of mass unemployment among knowledge workers, I’m not sure society as we know it will survive.

我对 LLM 的立场只有一部分是基于我个人的社会经济地位。我已经足够年长,也已经取得了足够的成功,在其他条件相同的情况下,我能够承受失业。但另一方面,我不确定任何知识型社会能否承受这一点。LLM 可能会在取代其他白领工作之前先取代程序员的工作。毕竟,编程可能是一门比保险理赔管理更容易验证成果的学科。尽管如此,如果我们达到知识工作者大规模失业的地步,我不确定我们所知的社会能否存续。

I usually don’t talk much about my background as an economist, but in this context I find it relevant to mention. As an economist, I can’t imagine that mass unemployment of 30-40% will not have a significant impact on the economy. I’m painfully aware of the arguments that this has happened before: There may be job loss, but the advance of technology leads to new jobs we can’t even imagine today. It was like that with the introduction of the stocking frame, the steam engine, the internal combustion engine, computers, etc. This is only partly true: Yes, new jobs were created, but often not for those people who lost their jobs. Coal miners didn’t just become programmers overnight. The same kind of argument was used when China was admitted to the World Trade Organization. And indeed, lots of new jobs were created, just not in the Western world. So, based on lived and historical experience, I’m sceptical of arguments that all will be fine. But I sincerely hope that I’m wrong. I love to program, and wouldn’t mind doing it for another ten years. Perhaps more importantly, I have young adult children. I hope that there’s a world for them, too.

我通常不太谈论我的经济学家背景,但在这种语境下,我觉得有必要提一下。作为一名经济学家,我无法想象 30%-40% 的大规模失业不会对经济产生重大影响。我非常清楚那些认为“这种情况以前发生过”的论点:可能会有失业,但技术的进步会带来我们今天甚至无法想象的新工作。针织机、蒸汽机、内燃机、计算机等的引入都是如此。但这只是一部分事实:是的,新工作确实被创造出来了,但往往不是为那些失去工作的人准备的。煤矿工人不会一夜之间变成程序员。当中国加入世界贸易组织时,也使用了同样的论点。确实,创造了大量新工作,只是不在西方世界。因此,基于生活经验和历史经验,我对“一切都会好起来”的论点持怀疑态度。但我真诚地希望我是错的。我热爱编程,不介意再做十年。更重要的是,我有年轻的孩子。我希望这个世界也能为他们留有一席之地。

“So I’d really like to know how you think about this. Are you glad you learned programming fundamentals before LLMs existed? If you were starting today, would you still seriously study languages, data structures, databases, networking, operating systems, debugging and architecture? Do you think AI can let people become capable of building much faster than they become capable of understanding?”

“所以我真的很想知道你是怎么想的。你是否庆幸自己在 LLM 出现之前就学习了编程基础?如果你今天才开始,你还会认真学习语言、数据结构、数据库、网络、操作系统、调试和架构吗?你认为 AI 是否会让人们在构建能力上的提升速度,远超他们理解能力的提升速度?”

Am I glad that I learned programming before LLMs? Yes, of course. Those skills served me well for thirty years. If I was starting today, I’d seriously consider learning carpentry, metalworking, gun-smithing, or something else that requires hand-eye coordination. I know that advances are made in robotics, too, but replacement of manual labour seems to lie farther in the future. But to address the question: I am, personally, currently learning data structures, language semantics, etc. as part of a university programme. I do that because I’m curious, however, and not because I expect to get much monetary reward out of it. Do I think that AI enables people to develop faster than they can keep up? This remains to be seen. Software developers have already, for decades, been working on top of abstractions they didn’t understand. If you were a web developer, you didn’t know much about compiler programming. If you were a compiler programmer, you didn’t know much about integrated circuit design. And if your job was to engineer integrated circuits, you wouldn’t know much about the levels of abstraction above you. A good rule of thumb was: Understand the level below you.

我是否庆幸自己在 LLM 出现之前就学习了编程?是的,当然。这些技能在过去三十年里对我帮助很大。如果我今天才开始,我会认真考虑学习木工、金属加工、枪械制造或其他需要手眼协调的技能。我知道机器人技术也在进步,但体力劳动的替代似乎还在更遥远的未来。但回到你的问题:我个人目前正在大学课程中学习数据结构、语言语义等。我这样做是因为好奇,而不是因为我期望从中获得多少经济回报。我认为 AI 是否让人们的发展速度超过了他们的理解速度?这还有待观察。几十年来,软件开发人员一直是在他们不理解的抽象层之上工作。如果你是 Web 开发人员,你对编译器编程知之甚少;如果你是编译器程序员,你对集成电路设计知之甚少;而如果你的工作是设计集成电路,你对你之上的抽象层也知之甚少。一个好的经验法则是:理解你之下的那一层。