主持人
The seagull. The seagull. Because it should
Seagull,对。因为它……
嘉宾
You fly in, you make a bunch of noise, you crap all over everything, and then you fly out. Yeah.
你飞进来,制造一大堆噪音,到处拉屎,然后飞走。
主持人
Yeah. And you drop skin in the game. Yeah. And it's interesting because we've anyone who's worked in in teams of a certain size or or certain tenure, you see it happen. And it doesn't really matter how highly skilled that person is. There might be a few exceptions, but generally if you don't have skin in the game, you just make different decisions.
对,而且没有 skin in the game。很有意思,任何在一定规模或有一定历史的团队工作过的人,大概都见过这种情况。那个人的能力有多高并不真正重要,或许有少数例外,但通常只要没有 skin in the game,作出的决定就会不同。
And then after Tektronics, you worked at Apple. I only realized this about you. What how did you get into Apple? This was in 1987. It's a very exciting time from from my research. How did you get in there? What did you do there? So, Small Talk was going up like a rocket at that time. Xerox had developed Small Talk. It handed it to four I think companies to see can you also implement it or is this something special. So HP, Apple, Tektronics and blanking on the fourth one.
离开 Tektronix 后,你去了 Apple。我也是最近才知道这件事。你是怎么进入 Apple 的?那是 1987 年,从资料来看是非常令人兴奋的时期。你怎么进去,在那里做什么? Smalltalk 当时正在像 rocket 一样上升。 Xerox 开发了 Small talk,然后交给了我记得是四家公司,看看别人是否也能实现,还是只有 Xerox 能做到。包括 HP、Apple、Tektronix,第四家我记不起来了。
HP really didn't do anything with it but Apple and Tektronics ran with it. So Apple had its own implementation of Small Talk and they wanted to not commercialize it in the sense of selling it, but commercialize it in the sense of having something that this was right after the Mac had come out, something that you could use on a Mac. And so I I knew about that project. It was getting too big for my britches at Tektronics. I I learned a lot.
HP 并没有真正做什么,但 Apple 和 Tektronix 都认真推进了。 Apple 有自己的 Smalltalk implementation,他们希望将它 commercialize,不是指把它作为商品出售,而是做成实际可用的东西。当时 Mac 刚发布,所以他们想让它能在 Mac 上使用。我知道这个 project。
You know, there's a there's a thing there's this kind of compression that happens when you're growing faster than the organization can recognize that you're growing, but also you're not growing as fast as you think you're growing. And eventually that gap between how people see you and how you see yourself and then somewhere in between is how you really are. Those if those gaps get too wide, you just have to move. So, I was ready to move on.
与此同时,我在 Tektronix 已经有点自以为是,但确实学到了很多。人快速成长时会发生一种 compression:你的成长速度超过 organization 能意识到的速度,但同时又没有自己以为的那么快。最终,别人眼中的你与你眼中的自己之间会出现 gap,而真实的你大概在两者之间。如果这些 gaps 变得太大,你就只能离开。因此我已经准备好进入下一站,于是联系了 Apple。
So, I contacted Apple and I I worked for about a year on the Small Talk project, which ended up going nowhere cuz it really didn't make sense. Small Talk could work in quite a small memory footprint, but the the only developer tools Apple really needed was a C compiler, Pascal compiler,because that that's what they built their software on mostly C. That's what they built their software on. That's what everybody else did.
我在 Smalltalk project 做了大约一年,最后它没有走向任何地方,因为确实不合理。 Smalltalk 可以在很小的 memory footprint 中运行,但 Apple 真正需要的 developer tools 只有 C compiler 和 Pascal compiler。因为他们的 software 主要就是用 C 构建。对,他们自己的 software。
There there was a thriving third market uh for other developer tools. But the small talk wasn't going to do really do anything for anybody. Maybe school kids or something, but it wasn't it wasn't driving Apple sales. People who bought Apple computers typically didn't want to do small talk. Right. Correct. So So we talked about the decline of small talk.
如此,其他人也是如此。当时其他 developer tools 有蓬勃发展的 third-party market。但 Smalltalk 不会真正为谁带来价值,或许 school kids 除外;它无法推动 Apple 的销量。购买 Apple computers 的人通常并不想使用 Smalltalk。
I'm sensing around this time it's if if you know like as personal computers started spreading it's it seems like it just remained the niche right no it was quite strong at that time it was growing fast um lots of people like relative to the previous year were using it a company had spun out of Xerox called Park Place uh which was selling small as a big ticket item for developers and this is before there was open-source out there.
对。所以我们谈到了。 Smalltalk 的衰落。我感觉大概就在那时,随着 personal computers 开始普及,它似乎只停留在 niche,对吗?不,它当时非常强势,增长很快。与前一年相比,使用它的人很多。一家名为 ParcPlace 的公司从 Xerox 分拆出来,把 Smalltalk 作为高价 developer 产品出售。
So the idea that you could set you could charge money for a language implementation was a lots of people were doing that kind of thing and this was running out of that same kind of playbook.
当时还没有 open source,所以可以为一门 language implementation 收费的想法并不稀奇,很多人都这么做,它也沿用同一套玩法。
嘉宾
Okay. So it was still doing it. It would just didn't make sense for Apple's customer base.
明白,所以 Smalltalk 当时仍然发展不错,只是。不适合 Apple 的 customer base。
主持人
Correct.
对。
嘉宾
And and their hardware.
也不适合他们的 hardware。
主持人
Yeah. Also though at the same time a bunch of the ex Xerox people had come to Apple. So my friend Larry Tesler was there and by friend I mean bitter enemy who I respected a lot. Sometimes you know you there are people who just raised the hair on the back of your neck and Larry Tesler was one of those to me and I don't know if even the feeling was reciprocated.
对。不过与此同时,一批原 Xerox 员工来到 Apple。比如我的朋友 Larry Tesler——所谓朋友,是指我非常尊敬的死对头。有时就是会遇到一种人,让你后颈的毛竖起来,Larry Tesler 对我就是这种人。我甚至不知道这种感觉是不是双向的。他几年前去世了,所以我再也没机会和他谈这件事,但我们当时确实会交谈,后来也会互相联系。
He passed a few years ago, but so I never got a chance to talk to him, but I talked to him, you know, we would check in afterwards. Anyway, he was the head of the advanced technology group at Apple at that time. Alan K had moved to Apple and was working on a programming language for kids, another programming language for kids called Playground. Dan Dan Engles was there.
总之,他当时是 Apple Advanced Technology Group 的负责人。 Alan Kay 已经来到 Apple,正在开发另一门面向 kids 的 programming language,叫Playground。 Dan Ingalls 也在那里。因此,很多 Xerox 的人都在 Apple。
So, a lot of the Xerox folks were were at Apple and I heard about Alen K's project and thought that was a dream of mine. Bite magazine had an article on small talk. I read about the development of Small Talk. The project started in like 71 and it was 1980 before they released anything at all publicly. And just imagining working in that environment just seemed like heaven to me. So, I moved to the Alan K's playground project. Now, I was horribly ineffective.
我听说 Alan Kay 的 project 后,觉得那就是自己的梦想。 《Byte》magazine 曾刊登一篇关于 Smalltalk 的文章,我从中读到 Smalltalk 的发展过程:project 大约始于 1971 年,直到 1980 年才公开发布任何东西。仅仅想象能在那种 environment 中工作,对我就像天堂。所以我转去了 Alan Kay 的 Playground project。
Uh, ended up getting fired from that job.
可我在那里极其低效,最终还被解雇了。
嘉宾
No way.
不会吧。
主持人
Yeah. Oh, sure.
当然是真的。
嘉宾
As as a programmer, you being inefficient. What happened?
你作为 programmer 居然会低效。发生了什么?
主持人
I wanted to do my own thing. And this was still, you know, I'm still in this punk mode where I'd listen to somebody else's ideas and I go, "Nah, I don't think so. I have a better idea." And if you're working by yourself, that's okay. But if you're working in a team, that's not okay. So, uh, uh, the it came to a head. I was the program chair for the oops conference, which we probably should have mentioned earlier.
我只想做自己的东西,而这。时我仍处于 punk mode:听完别人的 ideas 会说:“不,我不同意,我有更好的想法。 ”如果独自工作,这没问题;但在 team 中就不行。最后矛盾爆发了。我当时还是 OOPSLA conference 的 program chair,这件事也许早该提到。那是当时最热门的 conference,所有重要人物都会参加,而且增长很快。
Um there was this conference and it was the hottest conference and everybody who was ever anybody was there and it was growing fast and I was involved in it kind of stumbled into it but I was in ' 89 I was the program chair for oops right for oopsla and I spent a month just reading papers while uh ignoring my duties to the playground project and that was kind of the final straw. okay, you're you're not helping us, so you you need to move on.
我有点偶然地参与其中,1989 年担任 OOPSLA 的 program chair。为了读 papers,我整整一个月忽略了自己在Playground project 的职责,这成了最后一根稻草。对方说:“好吧,你没有在帮助我们,所以你得离开。 ”后来 conference 举办时,我的第二个孩子又迟迟不肯出生,导致我甚至没能参加。
And then the conference happened and my second child was busy not being born. So I didn't even get to attend the conference, but I had heard about the playground project. So I moved to the playground project and and did a little bit to help build this programming language for kids. That was the next thing beyond object-oriented programming. You would you would call it today you'd call it reactive programming. So you didn't you couldn't send a message.
但我之前听说过 Playground project,于是转去那里,并为构建这门 kids programming language 做了一点贡献。它是 object-oriented programming 之后的下一步;用今天的话说,你会称它为 reactive programming。你不能直接发送 message,只能触发某种 condition,让另一个 object 等待它。
You could only raise some condition that some other object would would be waiting on. So it's like pub sub but that was the only control mechanism. And then I wanted to ask you about this this was around this time CRC cards. What are CRC cards? I know they stand for class responsibility collaborator cards but what were they and how did you come up with them?
因此,它很像 pub/sub,只不过这是唯一的 control mechanism。接着我想问问差不多那时出现的 CRC cards。 CRC cards 是什么?我知道它代表 Class–Responsibility–Collaborator cards,但它们究竟是什么,你是怎么想到的?
You have this these imperative programs and you have a flowchart which represents accurately if kind of verbosely the control flow in an imperative program. Now we have these objects and you send messages which are polymorphic. So you don't know exactly what code's going to be invoked when you send a message. And people were like, well, how do you even visualize, internalize? For me, I'm um I have kinesesthetic synesthesia.
对 imperative programs,你可以用 flowchart 相当准确、只是有些冗长地表示。 control flow。现在有了 objects,你发送的 messages 是 polymorphic 的,因此发送 message 时并不知道究竟哪段 code 会被调用。人们会问:那要如何 visualise、如何 internalize?对我来说,我有 kinesthetic synesthesia。
So, I can feel in my body if I'm looking at some code, I can feel in my body. It wants to go this way. It's Yeah. which is, you know, I've I don't know if I've met anybody else who describes their experience of programming in the same kind of way, but there we go.
如果看着一些 code,我能在身体里感受到它想往哪个方向走。是的,我不知道自己是否遇到过其他人也这样描述 programming experience,但就是如此。
How do you get a sense of however you internalize this of what's going on in this program where you you can't just say we execute this line and then we execute that line because as soon as we send a message, we don't know what's going to happen. So Ward came up with the idea to write down on cards, index cards, here's what's going on. Because we would we would talk this way all the time.
那么,当你不能简单地说“先执行这一行,再执行那一行”,因为一旦发送 message 就不知道接下来会发生什么时,无论你以哪种方式 internalize program,又该如何形成对它运作方式的感觉? Ward 提出,可以在 index cards 上写下正在发生的事,因为我们平时一直会这样交谈。比如,我们有一个 rectangle,它请求 renderer 做某件事,然后进入 pipeline,诸如此类。
So you know, we've got a we have a rectangle and it asks the renderer to do the thing and then that goes into the pipeline which dah. So we would talk with our hands a lot. So he said, "Well, why don't we write these things down on cards?" So a a big challenge in object-oriented programming is dividing the responsibilities because you're moving the computation to where the data is.
我们说话时经常会动手比画。于是他说:“为什么不把这些东西写在 cards 上? ”Object-oriented programming 的一个重大挑战是如何分配 responsibilities,因为你要把 computation移动到 data 所在之处。
Saying, "Well, this object does this and that object does that is a really critical decision because you want to you want the computation near to the data so that there's less coupling between them." which is a lesson that I I think uh kind of got lost in the noise. That's the fundamental design move in ob in designing object-oriented programs and I think I stand behind that. So so have the data be close to where it's used where the computation will happen
决定“这个 object 做这件事,那个 object 做那件事”极其关键,因为 computation 应靠近 data,这样两者之间的 coupling 更少。我认为这条 lesson 后来有点淹没在噪音里,但它是设计 object-oriented programs 时最根本的 design move,我现在仍然认同。所以,是让 data 靠近其使用位置,也就是 computation 发生处?
嘉宾
uh backwards
反了。
主持人
backwards
反了?
嘉宾
have have the computation move to where the data already lives
应该让 computation 移动到 data 已经存在的地方。
主持人
have the computation move to where the data is. So like if you have a rich object with the lots of data inside of it for example, you want the computations to move there. So you want the like objects to invoke and just just get the data and do whatever computation they need to.
让 computation 移动到 data 所在之处。比如你有一个内部包含大量 data 的 rich object,就希望 computation 移到那里;让 objects 去调用它,只获取 data,并执行所需 computation。
嘉宾
If I'm going to operate on stuff that's on the inside of a rectangle like area.
如果我要操作 rectangle 内部的内容,比如 area。
主持人
Yeah. Do I have height time width scattered all over the universe or do I have an area inside the rectangle that does height and width at the limit? Now I don't care that the rectangle has height and width that's hidden from the rest of the world. Like I can I can represent the rang rectangle with two corners
对。我是把 height 乘 width 的计算散落在整个 universe,还是在 rectangle 内提供一个 area,用它计算 height 乘 width?做到极致后,我甚至不关心 rectangle 是否真的存有 height 和 width;那对外部世界是隐藏的。我可以用两个 corners
嘉宾
or I can represent the rectangle as a top left a height and a width. Mhm. To the rest of the world, it doesn't matter as long as they both respond to area. So now I can come up with another representation and another representation and the rest of the world doesn't have to care if I've moved the computation where the data lives. Yes. And that means you can have looser coupling. Correct. Understood. It's a good lesson.
表示 rectangle,也可以用 top-left、height 和 width 表示。嗯。对外部世界来说,只要它们都响应 area,就没有区别。于是我可以采用一种又一种新的 representation,而只要 computation 已移到 data 所在之处,外界就不需要在意。对,这意味着 coupling 可以更松。正确。明白了,这是个很好的 lesson。
主持人
Yeah. Yeah. Yeah.
对。
嘉宾
And and even today cuz everything that we do is under the hood. Almost everything we do is object. A lot of it is object-oriented. And I don't think we think about these.
而且今天仍然适用,因为我们所做的一切在底层几乎都是 objects,很多都是 object-oriented,但我觉得我们并不常思考这些。
主持人
Yeah, I see a lot of criticism of programs written in object-oriented languages that aren't criticisms of object-oriented programming or design. So after Apple, you moved to a company called Maspar. And the thing that I notice here is unit testing. This was the place where, as I understand, you came up with something called SUnit. While I was at Tektronics, uh, I got interested in testing. At that point, testing was a sociological divide.
我看到很多对 object-oriented languages 所写 programs 的批评,其实批评的并不是 object-oriented programming 或 design。离开 Apple 后,你去了名为 MasPar 的公司。我在这段经历中注意到的是 unit testing。据我了解,SUnit 就是在那里出现的。我在 Tektronix 时开始对 testing 感兴趣。
If you got A's and B's in computer science school, you got to program. And if you got C's, you had to be a tester. So, it really was like a status. I'm not going to test. I'm I'm one of these guys, not one of those. But I got interested in how would you automatically test programs? How would you get a sense of confidence in what you were doing? So, I tend to be an anxious person and the more complicated my programs were, the more I had to be anxious about.
当时 testing 有一条社会身份分界线:computer science 学校里拿 A 和 B 的人可以做 programming,拿 C 的人就得做 tester。因此,它确实是一种 status:“我不做 testing,我是这边的人,不是那边的人。 ”但是我开始对如何自动测试 programs、如何对所做之事建立 confidence 感兴趣。
The more experience I had with what kind of bugs could possibly exist, the more anxious I got. And I thought there was just some way to kind of quell this without pills. That would be great. I tried out a bunch of different approaches to writing automated tests. At that point in addition to this this uh status divide there was a tool divide. You had testing tools which would have their own kind of language and some way to connect with the program that was under test.
我本来就容易焦虑,program 越复杂,值得焦虑的事情就越多;越有经验、越知道可能存在什么 bugs,我就越焦虑。我想,如果有什么不用吃药就能压下这种焦虑的方法,那就太好了。我试过许多不同的 automated tests 写法。当时除了 status divide,还有 tool divide:testing tools 有自己的 language,再以某种方式连接受测 program。
So I tried this and that and the other thing. It was actually after Maspar that uh I think is all ancient history. So we'd have to go you know dig through the archaeological layers. I started consulting and I was going to tell a client that they should write tests. I was going to fly out to Chicago the next day, but I didn't have any way for them to write tests. So, out of these five or six experiments that I'd done, I synthesized test case, test suite, and test result.
我尝试了这个、那个和其他方案。实际上,应该是在离开 MasPar 之后,不过这一切都属于 ancient history,得挖开考古层才能确认。我开始做 consulting,准备告诉一位 client 应该写 tests。我第二天就要飞去 Chicago,却还没有任何工具能让他们编写 tests。于是我把之前做过的五六个 experiments 综合起来,形成 TestCase、TestSuite 和 TestResult,一共大约三个 classes和 12 个 methods。
That was the it was like three classes and 12 methods. But it was a framework where you could write tests that would execute isolated from each other fully automatic and give you a rollup of the results of it.
但它是一个 framework:可以编写彼此隔离执行、完全自动化的 tests,并获得汇总结果。
嘉宾
So this was pretty much a unit testing framework for small talk.
所以,这基本上就是 Smalltalk 的 unit testing framework。
主持人
It was written in yeah the first version was written in small talk. So, Maspar was a Silicon Valley startup venturefunded intended to build an entire new architecture which was uh SIMDI single instruction multiple data. So, we would have a Taurus of process processing elements uh up to 16,000. So, you have 16,000 and they're connected in a toridal grid. So you could talk to the the processing elements in your left, right, up, down, and diagonally.
对,第一版是用 Smalltalk 写的。 MasPar 则是 Silicon Valley 的 venture-funded startup,目标是构建一种全新 architecture,即 SIMD——single instruction, multiple data。我们会有一个由 processing elements 组成的 torus,最多达到 16,000 个。也就是说,16,000 个 processing elements 连接在 toroidal grid 上,可以与左、右、上、下及对角方向的processing elements 通信。
And it looks very much like the Nvidia architecture now, but this was way back when, and it was just too early. So three years of that building programming environments for high performance computing. So the intention was to get the kind of performance you'd get out of a cray at that time um but for a tenth the cost and they needed a programming environment. So we built a programming environment in Small Talk that did some really cool stuff.
它看起来很像今天的 NVIDIA architecture,但那是在很久以前,实在太早了。我在那里做了三年,为 high-performance computing 构建 programming environments。目标是获得当时 Cray 级别的 performance,但成本只要十分之一,而它需要 programming environment。于是我们用 Smalltalk 构建了一个很酷的 programming environment。
You could you could single step a forran program and build a performance profile at the same time.
你可以对 Fortran program single-step,同时建立 performance profile。
嘉宾
No way. So you built a runtime that allowed you to do in in small talk to interpret for example program programs and run them.
不会吧。所以你们构建了一个 runtime,允许你在 Smalltalk 中解释执行例如 Fortran programs。并运行它们?
主持人
No the we had a a standard compiler an optimizing compiler but because we had we controlled the operating system we could build really low-level probes to collect performance profiling data. So we could get line level profiles for these four trend programs running on 16,000 processors and great gobs of data.
不,我们使用标准的 optimizing compiler;不过由于 control 了 operating system,我们可以构建非常 low-level 的 probes 来收集 performance profiling data。因此,运行在 16,000 个 processors 上的 Fortran programs 可以获得 line-level profiles,以及海量 data。
嘉宾
That's awesome. Like when you're going from not just like you're going to lower level, you know, like building infrastructure that runs programs, but then I want to go back to to SUnit. So the concept of of SUnit, the the these concept you put together a test case. What was it? the test case,
太棒了。你不只是往 lower level 走,比如构建能运行 programs 的 infrastructure。不过我想回到 SUnit。SUnit 的概念是你把 TestCase……还有什么?
主持人
test suite and test result.
TestCase、TestSuite 和 TestResult。
嘉宾
This really became sticky because then there was JUnit which you later created with with Eric Gama and there's a whole suite uh nunit for uh I think that was fornet xunit.net all of them took over some of these ideas and a lot of modern unit testing frameworks are built on some of these ideas. Why do you think it was so sticky and why do you think it wasn't created beforehand? So beforehand because of this social divide between programmers and testers.
这套东西真正流传了下来。后来你和 Erich Gamma 创建 JUnit,接着出现了整个系列,比如我想用于 .NET 的 NUnit、xUnit.net 等。它们都继承了其中一些 ideas,许多现代 unit testing frameworks 也建立在这些 ideas 上。你觉得它为什么如此有生命力?
There was a lot of incentive for the testers to have their own language. This is my tool. I know how to run it. I'm going to run it. And it was very adversarial at that time too and kind of patronizing like you're a programmer. you can't be trusted to test, you know, you'll just say it works fine. I'm going to be the adult supervision, you know, and sometime and sometimes the programmers really did act that way.
为什么此前没人创造出来?此前 programmers 与 testers 之间存在社会分界,因此 testers 很有动力拥有自己的 language:“这是我的 tool,我知道怎么运行,我来运行。 ”而且当时双方关系非常 adversarial,甚至有点居高临下:“你是 programmer,不能信任你来。 test,你只会说它运行得很好。我得来做 adult supervision。 ”有时 programmers 确实会那样表现,所以也很难反驳。
So I, you know, hard to hard to argue with, but I think that encouraged this idea that a testing tool is its own its own world. the inspired decision to use the same language to test as you're testing. It was a natural decision because I was in small talk and you should be able to represent anything in small talk. So, you know, and I was just used to how do I represent this as objects. So, sounds like small talk as a language has been early to a lot of things.
但我认为,这鼓励了“testing tool 是一个独立世界”的观念。而使用与被测 program 相同的 language来写 tests,是个有灵感的决定。它又很自然,因为我身处 Smalltalk,而你应该能在 Smalltalk 中表示任何东西。我只是习惯思考如何把它表示成 objects。听起来 Smalltalk 这门语言在很多事情上都非常早。
I sense a lot of innovation coming from small talk because it was one of the first languages that did have objects but it was a very simple language. So you needed to build a lot of things which then led to representing a lot of things to talking about them design patterns and now also you know being able to write your test environment if if you or being forced to do so if if you wanted to do it. Well there was an ethos that went along with small talk.
我能感觉到很多 innovation 来自 Smalltalk,因为它是最早拥有 objects 的语言之一,同时又非常简单,所以你必须构建许多东西,这。又促使你表示许多事物、讨论它们、形成 design patterns;现在还包括编写自己的 test environment——如果想做 testing,你需要甚至被迫自己完成。 Smalltalk 同时带有一种 ethos。
So if you didn't like the tools, if you're running the debugger and the debugger doesn't have some feature that you really need right now, you just hop on the stack,implement the feature that you want, and then get back to whatever it was you were doing. That was just a natural thing because there was never this huge gap. You know, imagine today, uh, I'm using a C compiler and I realize, oh, I wish C had this new feature.
如果不喜欢现有 tools,比如正在 debugger 中运行,却发现 debugger 缺少此刻真正需要的功能,你只要跳到 stack 上,实现想要的功能,然后回到刚才的工作。这是一件很自然的事,因为两层之间从来没有巨大的 gap。想象今天,我正在使用 C compiler,突然发现:“哦,希望 C 有这个新 feature。 ”这意味着要启动一个 multi-year project,跨过进入下一层的巨大门槛。
We're embarking on a multi-year project to go and like the huge barrier to entry to go to the next level. And in small talk by design, for example, you have pop-up menus and they you can see all of the options right there. That's a deliberate pedagogical choice. It says, "Okay, well, you know about cut and paste, but you don't know the other things that you can do right here." So the menu doesn't just give you cut and paste.
而 Smalltalk 通过design 避免了它。比如,系统有 pop-up menus,你可以直接看到所有 options。这是一项刻意的 pedagogical choice,意思是:“好,你知道 cut 和 paste,但还不知道这里能做的其他事情。 ”所以 menu 不只提供 cut 和 paste,而是列出能做的一切,以鼓励你了解它们。
It gives you all the things that you can do as a way to encourage you to learn about them because eventually you're going to I see this format item here and I well what does that do? So that was very much part of the small talk ethos that this system would teach you as you kept using it. So yeah it was very natural to build the testing tool in the language. And of course you have to kind of bastardize the language a bit here.
因为你最终会看到这里有个 Format item,然后想:“这是做什么的? ”Smalltalk ethos 中很重要的一点,就是 system 会随着使用不断教你。所以,用同一门 language 构建 testing tool 非常自然。当然,你也得稍微扭曲一下 language。
Here I've got this this class for some test case and I have a method which is one of the test cases and it starts with t is kind of magic you know uh this is getting squidgy and then when you execute it you create one of these objects you send it setup because you don't you know may have to build some stuff and then you send it the test t something or other and it executes that one thing and then you Then assuming well then regardless you run the tear down from that.
这里有某个 TestCase 的 class,还有一个代表其中某个 test case 的 method,它以 `test` 开头,多少带点 magic,事情开始变得不那么干净。执行时,你创建这样一个 object,向它发送 `setUp`,因为可能需要先构建一些东西;然后向它发送 `testSomething`,它执行这一个 test,接着。无论结果如何,都运行 `tearDown`。
So it's not it looks like the the syntax is the same as the language. The the representation of the tests you kind of borrow from the representation of just any kind of code and then you interpret it yourself. So it's it it it it it's in the language but it's not really in the language at the same time. But people don't think about that.
因此,它的 syntax 看起来和 language 相同;tests 的 representation 借用了任何普通 code 的 representation,再由你自己解释执行。所以,它既在 language 之内,同时又不真的属于 language。不过人们不会想这些,只会觉得:“我 subclass 这个 class,提供一个带 `test` annotation 或以 `test` 开头的 method,然后它就能工作。
They just think I subclass this I give a method with the annotation of test or with starts with tst and then it just starts working and that's fine. I want to jump to a few years later from to 1996 you started to work on a project at Chrysler and this is where you met Martin Fowler. What was this project?
”这已经足够。我想跳到几年后的 1996 年。你开始参与 Chrysler 的一个 project,也是在这里遇到了 Martin Fowler。这个 project 是什么?
I'd actually met Martin Fowler a little bit before that. So as early as the first oops conferences, the question of how do we manage projects with objects differently than we manage projects with the previous generation of tools. The previous generation of tools definitely gave you a many fewer options for change. You'd still have to change code, but it was just a lot harder compared to working with object-oriented programs. So what is the methodology?
其实更早一点我就认识 Martin Fowler。最初几届 OOPSLA conferences 就提出过这样的问题:管理 objects project 的方式,应如何区别于管理上一代 tools project?上一代 tools 当然让 change 的选择少得多,仍然需要改 code,但与 object-oriented programs 相比困难得多。那么 methodology 应该是什么?
We had we had the structured analysis, structured design. What is the methodology for um for objects and how should it be different? That was the million-dollar question at the original 86 oops law. By the time 9495 rolled around, we were starting to get a clue what that would look like. There were I think uh the rational and unified process or the the things that would go into the rational unified process already existed by that time which was
我们曾有 structured analysis、structured design。面向 objects 的 methodology 又是什么,它应该有何不同?这是 1986 年首届 OOPSLA 的 million-dollar question。到 1994、1995 年左右,我们开始大致知道它会是什么样。那时可能已经有Rational Unified Process,或构成它的那些要素。
主持人
Brady Buch was involved in that.
Grady Booch 参与了。
嘉宾
Brady BC Evar uh James Rumba Ivar Yakabson. So people were coming up with some kinds of answers. Ward had come up with his own uh answer called episodes written into as a pattern language because we were like you know I don't have a big bag of tricks I have to keep using them over again and the same is true turns out of of everybody. So you can find that episodes on uh Ward's C2 site. It's really interesting to compare that because I I borrowed heavily from that.
Grady Booch、Ivar… … James Rumbaugh、Ivar Jacobson。所以,人们开始提出不同答案。 Ward 也提出了自己的答案,叫 Episodes,以 pattern language 写成。因为我们的想法是:“我没有一大袋 tricks,只能反复使用手中那几招。 ”事实证明每个人都一样。你可以在 Ward 的 C2 site 找到 Episodes。
I borrowed from everything else that I had seen and experienced. But at that point, I'd been when did I leave Masspar? 92. So I had been an independent consultant for four years at that point. And there were a couple of workshops uh held in Snowbird. I don't know why we picked Snowbird, but somebody else did uh about this methodology question. Um, and I met Martin at the first one of those that I attended. And his introduction was, it's just the classic Martin introduction.
把它拿来对照很有意思,因为我大量借鉴了它,也借鉴了我看到和经历过的其他一切。那时,我什么时候离开 MasPar? 1992 年。所以到那时,我已经独立 consulting 四年。 Snowbird 还举办过几次讨论 methodology question 的 workshops。我不知道为何选 Snowbird,是别人选的。我在第一次参加的 workshop 遇到 Martin。
He said, "I am the only person here I've never heard of." And he was already doing some some great work on uh analysis patterns uh at the time, which I knew about. So, I was excited to to meet him. Get to this Chrysler project. The project's important for Y2K, but it's not clear that it's going to be finished in time. Martin was already there as a consultant. Uh I had met Ron Jeff doing small talky stuff.
他的自我介绍是很典型的 Martin 风格,说:“我是这里唯一一个我自己从未听说过的人。 ”他那时已在 analysis patterns 上做出很好的工作,我也知道,所以很高兴见到他。后来便来到Chrysler project。这个 project 对 Y2K 很重要,但不确定能否按时完成。
I don't remember exactly how we met, but long story short, I came in as I know lead consultant or something restarting that project in a very different development style. And for that style, I took everything that I knew that was useful and cranked it up to 11 and discarded all the stuff that I couldn't prove we needed. So that was the value system behind this new style of development. Uh Martin and I would visit there periodically. Ron was there full-time.
Martin 已经作为 consultant 在那里。我做 Smalltalk 相关工作时认识了 Ron Jeffries,具体怎么认识的记不清了。长话短说,我以 lead consultant 或类似身份加入,以一种非常不同的 development style 重启 project。对于这种 style,我把自己知道有用的一切全部调到 11,并丢弃所有无法证明为必要的东西。
I was originally brought in as a performance consultant because I knew a lot about small talk performance and they were using a database called gemstone which it was small talk objects small talk semantics but coupled with persistence transactions indexes all that database good stuff but it wasn't going fast enough so I said well where's the test case that makes sure that I don't break something if I make some changes and I said well actually it's not computing the right answers yet.
这就是新 development style 背后的 value system。 Martin 和我会定期去那里,Ron 则全职在场。我最初是作为 performance consultant 被请来,因为很了解 Smalltalk performance。他们使用名为 GemStone 的 database,它有 Smalltalk objects 和 semantics,同时结合 persistence、transactions、indexes 等所有 database 的好东西,但速度不够。
And I said, "Well, then I can make it go really fast." And they didn't like that answer very much. Anyway, most change I've ever seen over the course of one week. At the end of which, everybody was exhausted. They've been working very long hours. I said, "Send everybody away for 2 weeks. Tell them to get some rest. We'll come back. We'll throw away all the code that we've written so far, and we'll restart." And we restarted on this 3-w weekek cadence.
于是我问:“如果我要作出一些 changes,确保不会破坏其他东西的 test case 在哪? ”他们说:“其实它现在还算不出正确答案。 ”我说:“那我能让它跑得非常快。 ”他们不太喜欢这个回答。总之,那一周发生了我见过最多的变化。结束时所有人都筋疲力尽,因为长期加班。
Every three weeks we would have more test cases specified by Marie, the payroll expert would be working and then we'd start another 3-we segment and another and another. No, it turns out those 11s that we turned everything to, there were several notches beyond that, but it was just that was the most intensely we could imagine replanning, integration, deployment, refactoring, and so on. The ideas that went into that was this synthesis of all these experiences that I'd had.
我说:“让所有人离开两周,休息一下。回来后,扔掉目前写的所有 code,重新开始。 ”于是我们以三周为 cadence 重启。每三周,由 payroll expert Marie 指定的更多 test cases 都会开始工作;然后进入又一个三周 segment,再一个,再一个。
And then so this is from from Ward when the two of you started to pair and pass the keyboard and and decide on all the different things that you're going to do your experience with tests as as a concept of that it doesn't needs to be the testing team that does it themselves but you can do it yourself in your own language which was just new new and and so all of these ideas just all came together. Yeah. And then when did you give it a name? It started going well.
事实证明,我们把所有实践调到的 11之上其实还有好几档,但那已经是我们能想象的、在 replanning、integration、deployment、refactoring 等方面最激进的程度。这些 ideas 是我全部经历的综合。所以,其中有你和 Ward pairing、来回传递 keyboard、决定各种工作的经验;还有你对 tests 的理解,即 testing 不一定要由 testing team 独立完成,而是可以用自己的 language 自己做。
At first I was like I was excited. I was scared. I was excited. Then it started going really well. So like the project started to go visibly well. Yeah. Yeah. After my like six weeks and then I was happy to be telling my friends about it. This new style of working that we're doing here at Chrysler. This new style of working we're doing here at Chrysler. This new style. They got kind of old to say that over and over again.
这在当时全是新鲜事,所有 ideas 就这样汇聚到一起。对。那你什么时候给它命名?它开始进展顺利。最初我既兴奋又害怕,后来真的变得非常顺利。也就是说,project 开始明显顺利起来。对。大概六周后,我已经很乐意向朋友们介绍:“我们在 Chrysler 使用的这种新工作方式。 ”反复说“我们在 Chrysler 使用的新工作方式”,说久了也很烦。
So now I'm back with the C thesaurus trying to figure out what are the words called us.
于是我又拿出 thesaurus,寻找应该用什么词来称呼
主持人
I thought we were really on to something that was going to be big. So I wanted to protect it. Apologies to Grady who's a good friend now. But um I didn't want Grady BCH to ever say that he was doing this thing. So, I had to pick I had to pick a moniker that was unattractive enough that somebody would try and steal it. And this is about the point at which uh you're you're now this punk again. Yeah. Well, yeah. I still am, but I'm just I'm just an older punk now.
我们。我认为这东西真的可能做大,所以想保护它。向 Grady 道歉,他现在是我的好朋友。但我当时不希望 Grady Booch 有朝一日说自己也在做这个。因此,我必须选一个足够不吸引人的 moniker,让别人不会尝试偷走它。而这大概也正是你再次变成 punk 的时候。对。其实现在还是,只是成了年纪更大的 punk。 [笑] 不过,这确实也有一点对 establishment 嗤之以鼻的意味。
Yeah. Yeah. But but a little bit of thumb the nose at the establishment. Extreme sports were there. I kind of like the analogy with extreme sports because you don't just hop on a snowboard at the top of some avalanche and the first time. No, you have to be supremely prepared. You have to have done all of your research and then if you have these outstanding skills, then you accomplish things.
当时正流行 extreme sports,我喜欢它与 extreme sports 的类比,因为你不可能第一次站上 snowboard,就直接从可能发生 avalanche 的山顶滑下去。你必须做好极其充分的准备,完成所有 research;只有拥有出色 skills,才能做到那些事。
嘉宾
Yeah. And training and all that,
对,还有 training 等等。
主持人
right? that seem impossible and are impossible if you haven't done all the prep. So it's accurate, it's edgy, it's the that word extreme and hence extreme programming was was born. That's so that's the extreme part. Extreme we had I knew that a bunch of people wouldn't like it but that's okay.
没错。那看起来不可能,而且在没有完成全部准备时也确实不可能。因此这个名字准确、edgy,而且包含 extreme 这个词,Extreme Programming 就这样诞生了。原来这就是 extreme 的来源。对。我知道很多人不会喜欢这个词,但没关系。
I started out calling it development which I still kind of like because there's more to delivering value with software than programming but the methodologies extent at that time treated programming as this clerical task.
最初我把它叫 Extreme Development,我现在仍有点喜欢,因为通过 software 交付价值不只有 programming。
We'll we'll we'll draw these diagrams and these diagrams and build this thing and the 14 ways to visualize this and then then there's some programming and then we'll draw some more diagrams and I thought programming sitting fingers on keyboard staring at code that's that's where I do my learning because that's where you can no longer fool yourself that you actually understand either you compute the correct value or you don't compute the correct value.
但当时的方法论把 programming 当成 clerical task:“我们先画这些 diagrams、那些 diagrams,构建这个东西,再用 14 种方式 visualise 它;接着做一点 programming,然后继续画 diagrams。 ”而我认为,坐下来、手指放在 keyboard 上、盯着 code,正是。我学习的地方,因为在那里你再也骗不了自己说已经理解。
So I wanted to elevate that moment of reality meets program and that's where the programming comes from. Now from very early days I also called it XP as uh a way of separating from the downsides of both of those words extreme and programming. So we can just call it XP and it's it's more of a generic thing. Not long after that, Microsoft releases Windows XP and there's an alternate universe in which I sued them and succeeded.
要么算出 correct value,要么没有。因此,我想抬高“现实与 program 相遇”这一时刻的地位,这就是 programming 一词的来源。从很早开始,我也把它叫 XP,以避开 extreme 和 programming 两个词各自的负面含义。我们可以直接叫 XP,让它变成一个更 generic 的东西。不久后,Microsoft 发布 Windows XP。
And there's another al alternate universe in which I sued them and failed and bankrupted myself and my children all starved to death. So,Right. Right. Cuz this was right around the year late '9s and XP came out. Yes. Soon after, I think 2000 or 2001, something like that. When did XP extreme programming recall start to become big? Was it as you gave it a name and you started telling people or then there was your book which came out in the year 2000?
存在另一个 universe,我起诉他们并赢了;也存在另一个 universe,我起诉他们却输了,导致自己破产,孩子们全饿死了。对,因为这是 1990 年代末左右,Windows XP 很快就在 2000 或 2001 年左右发布。 Extreme Programming 是什么时候真正开始走红的?是在你给它命名、开始告诉别人时,还是等 2000 年那本书出版之后?
I remember the first talk about XP I gave I had some flyers to hand out. So I think it was at an oopsum on a panel or something like that. I I talked some about XP and afterwards people were give me a copy. No, no. Uh uh uh uh uh uh. The reaction to it was just tugging on my shirt wanting a piece of this thing.
我记得第一次做 XP 演讲。时准备了一些 flyers,可能是在 OOPSLA 的某个 panel 上。我讲了 XP,结束后人们纷纷拉着我:“给我一份。 ”“不行,不行。 ”大家的反应就像不断拽我的 shirt,想要分到这个东西。
And I think the XP had exquisite timing in that the dot the upside, not the bomb, but the the upside of it was just starting to hit. They looked at other methodologies. It would say, you know, very carefully prepare, do this analysis document, do this design document, then a bunch of coding, then a bunch of testing.
我认为 XP 的时机好得不可思议。当时 dot-com 的上升期——不是泡沫破裂,而是上升——刚开始显现。其他 methodologies 都会说:“非常仔细地准备,完成这份 analysis document,再完成 design document,然后大量 coding,再大量 testing。
They could tell that's never going to work in a world that's changing as fast as the internet wave starting to crest, starting to come into, you know, the this super hyper growth. On the other hand, we know that this cowboy style of just, you know, you have the Jolt Cola, rest in peace, Jolt Cola, cowboy, you have a bunch of programmers, they do incomprehensible stuff, they don't talk to anybody, you just slide pizza under the door, and then you get the code out.
”人们看得出来,在一个变化速度像 internet wave 即将达到峰值、即将进入super hyper-growth 的世界里,这套方式永远行不通。另一方面,那种 cowboy style 也不行:准备 Jolt Cola——愿 Jolt Cola 安息——找一群 programmers,让他们做出无法理解的东西,彼此不沟通,你只需从门缝塞 pizza,最后 code 就出来了。
That's not going to work either. Here's this thing that looks like it's kind of in between the two. There's discipline to it. There's iteration to it. There's transparency to it. You have ways of steering what goes on. You have ways of tuning the process. You have all these tests to make sure that stuff actually works. You have frequent alignment between people, whether it's business people and technology people or technology people with each other.
这同样行不通。而这里有一个看起来介于两者之间的东西:它有 discipline、iteration 和 transparency;你可以 steering 工作方向,也可以 tuning process;还有所有这些 tests,确保东西真的能运行;人与人会频繁 alignment,无论是 business。 people 和 technology people 之间,还是 technology people 彼此之间。
Okay, I can see how this could work. And so they could see the internet is exploding and I can use XP to take advantage of that opportunity in a way that I I can't I don't there wasn't really another alternative to it.
好吧,我看得出这可能有效。因此,人们看到 internet 正在爆发,也看到可以用 XP 抓住这个 opportunity,而当时确实没有真正的 alternative。
嘉宾
Basically XP was giving you a way to move pretty fast and nimble but also have a sense of stability not just going wild. tests there. You had the iterations, the planning, the learning. And then when did TDD come along? Because there was a book that you you wrote that came out, I think two years later, uh, test-driven development by example. And how did it relate to XP?
简单说,XP 给你一种快速、灵活行动的方法,同时。也有稳定感,不是彻底失控。它包含 tests、iterations、planning 和 learning。那 TDD 是什么时候出现的?你两年后左右出版了《Test-Driven Development by Example》,它与 XP 有什么关系?
主持人
So TDD was an earlier test development. Test-driven development was an earlier rediscovery for me. Remember, I was a kid. I read all these books. I remember one of the books my dad brought home and I still haven't found a a copy of it. Said, "Here's how you program." This was back in the days of taped to tape.
TDD 更早。 Test-driven development 是我更早重新发现的东西。还记得吗?小时候我读父亲带回家的所有那些书。其中一本我至今没找到副本,里面写着:“这是编程的方法。
So, you'd have an input tape, you know, like time cards, and then you put it through the payroll program, which would write an output tape, which was like dollars for checks, dollars for withholding, etc., etc.
”那还是 tape-to-tape 的年代:有一盘 input tape,内容类似 time cards,然后送进payroll program,它会写出一盘 output tape,比如支票金额、withholding 金额等等。
嘉宾
Yeah. So it was always and then
对,所以它总是……
主持人
really back in the day and and you'd have these long strings of this and it's actually functional programming because you can't change the input tape but operating payroll or operating accounts payable or operating inventory was a process of I take these tapes I feed them into this program I take the output of that feed them into this program and blah blah blah blah blah blah and then you really manual like actually physically pulling a tape off and moving it over.
真的是很久以前。你会得到一长串这样的步骤。实际上这就是 functional programming,因为无法改变 input tape。运行 payroll、accounts payable 或 inventory,都是这样一个 process:把这些 tapes 送进这个 program,再把 output 送入下一个 program,如此继续。
Yeah. And it so it said here's how you write one of these programs is you take an input tape an actual input tape that you need to process and you manually type in the output tape you expect that to generate. You say okay well this number of hours uh should I I should have a record in the output that like this. So I see where we're going with this. You're you're defining the output. You're
而且真的是手工操作。对,真的把 tape 拿下来,再搬到另一边。书里说,编写这种 program 的方法是:拿一盘需要处理的真实 input tape,然后手工输入预期生成的 output tape。比如说:“好,这个工时数字,在 output 中应该生成这样一条 record。 ”
嘉宾
before you start on the program.
我明白接下来要讲什么了。你是在定义 output,而且是在开始写 program 之前。
主持人
Yeah. So first you need to know what do I expect? How can I validate it?
对。所以首先需要知道:我的预期是什么?如何验证它?
嘉宾
Correct. I had read that as a kid, didn't understand diddly squat, but but it's it's back in the back here someplace. I wrote sunit for the first started using it. Gave it to Hal Hildebrand, one of the smartest programmers. I knew I didn't figure he would need it. He used it. He loved it. So, I knew I was on to something with this this testing framework.
正确。我小时候读过这段话,完全没理解,但它一直藏在脑中某个角落。我写出 SUnit,开始使用它,并把它交给 Hal Hildebrand,他是我认识的最聪明的 programmers 之一。我没觉得他会需要这个,但他用了,而且很喜欢,所以我知道这个 testing framework 确实有价值。
And then I was just kind of farting around and remembered this typing in the output tape first and mapped that onto the testing that I was doing with SUnit. I went, well, if I followed that pattern, I would write the test before I wrote the code. And I can remember laughing out loud because it was such a stupid idea. Why would you write a test that you know is going to fail? you you don't even have the classes defined yet. You don't have the methods defined yet.
后来我只是随便尝试,想起了先输入 output tape 的做法,并把它映射到自己用 SUnit 进行的 testing 上。我想,如果遵循那个 pattern,我就会在写 code 前先写 test。我记得自己笑出了声,因为这主意实在太蠢了。为什么要写一个明知会失败的 test?
It's just it's going to fail a bunch of different ways before it could possibly succeed. Cool.
Classes 甚至还没定义,methods 也没定义;它会以各种方式不断失败,才有可能最终成功。太好了。
Let's try it and see what happens. So, I used stack as my first example. So, I have a stack new and I push something and I pop it. I should get the same thing back. Okay. And then I went to program it and okay, well, that's easy to satisfy that. What's the next one? You know, you push two things and you get them back in the right order. Okay. And this and uh dupe pop top is empty and finished. Where's the anxiety?
试试看会发生什么。所以我用 stack 作为第一个例子:创建一个新 stack,push 某个东西再 pop 出来,应该拿回同一个东西。好。然后开始实现:这个很容易满足。下一个呢?Push 两个东西,再按正确顺序取回。好。接着…… duplicate、pop、top、empty,然后完成。焦虑去哪了?
主持人
Oh, just gone. Oh, for the first time.
哦,完全消失了,第一次如此。
嘉宾
Wow. I can't imagine another test case that wouldn't pass. So, I'm really I'm finished and I feel great. I feel finished and I am finished. Wow. Go going from this is a stupid idea. Let's let's try it. Absolutely. No, I made a comment. Always try your stupid ideas if you can do it cheaply and reversibly. Jumping off a bridge is not a reversible decision. Not talking about that.
哇。我已经想不出还有哪个 test case 不会通过。所以我真的完成了,而且感觉很好。我既感觉完成,也确实完成。哇。从“这是个蠢主意”到“让我们试试”。绝对如此。我说过一句话:只要能以低成本、可逆的方式去做,就一定要尝试你的蠢主意。
I'm talking about stuff like this where you're just like, "Here's a stupid idea." 99 times out of a 100 it'll fail. But that one time you won't have any competition cuz nobody else is stupid enough to try this idea. Part of this punk attitude, I don't care what you think about this has enabled me to just try lots and lots of stupid ideas. And most of them you don't see, but there had been a string of them which worked out way better than they would have expected to work out.
从桥上跳下去不是 reversible decision,我说的不是那种。我说的是这种情况:你只是想,“这里有个蠢主意。 ”一百次中 99 次会失败,但成功的那一次,你不会有任何 competition,因为别人没蠢到会去试。我的 punk attitude 中有一部分是“不在乎你们怎么看”,它让我尝试了大量蠢主意。
Well, and then a bunch of other people tried these ideas as well. You know, like I think TDD is a good example where there was a time where shortly after you wrote the book about it as well. Uh it was it was a super popular book.
多数你们根本看不到,但确实有一串 ideas 最后的效果远远好于预期。后来很多其他人也尝试了这些 ideas。我觉得 TDD 是个好例子。你写书后不久,它曾非常流行。
I still remember I think I had a copy as well back in the late uh two 2000s people were like doing you know group exercises developers were developing accordingly over time it it probably dropped I would say in the 2010s I saw fewer and few people doing it uh and it almost went out of style completely and now with uh with agents the idea is back because turns out it might take more time what not but agent agents can do that but it's a It's pretty useful for them to test themselves.
我还记得自己在 2000 年代末可能也有一本。人们做 group exercises,developers 也照此开发。随着时间推移,大概到了 2010 年代,我看到使用它的人越来越少。它几乎彻底过时,而现在 agents 出现后,这个 idea 又回来了。它可能更费时间之类,但 agents 能做,而且让它们自我测试非常有用。
主持人
It costs tokens in the short run, but it can save them in the long run because one of the classic genie mistakes is stuff doesn't work. So, how do you how do you pull in the reins a little bit? And why did TDD go out of fashion? I I think uh there's a big part of it is I work on something for a while and then I switch to something else. That was true of patterns. It was true of Junit. It's true of TDD. It's true of XP. I just move on to the next thing.
短期会花费 tokens,长期却能节省,因为。 genie 最经典的错误之一就是东西不能工作。那么,要怎样稍微收紧缰绳? TDD 为什么会失去流行?我觉得很大一部分原因是,我做一个主题一阵子就会切换到别的。 Patterns 如此,JUnit 如此,TDD 和 XP 也如此。我只是继续做下一件事。所以我离开后,TDD 留在了那里。
So I moved on to the next thing. TDD is out there. And then there were people who used it as a moral cudgel. Like you should be if you're not using TDD, you're not professional. And that's just such People can write very good software with a wide variety of workflows. Now, there's advantages and disadvantages to different workflows. The sweet spot of TDD is this combination of discovery and realization. I kind of know where I want to go.
接着有些人把它当成 moral cudgel:“你应该这样做;如果不使用 TDD,就不专业。 ”这实在… …人们可以用多种 workflows 写出很好的 software。当然,不同 workflows 各有优缺点。 TDD 的 sweet spot 是 discovery 与 realization 的结合:我大概知道要去哪里,不完全知道如何抵达,但知道第一步是什么。
I don't know exactly I'm going to get there, but I do know the first step. So, I take the first step and that teaches me something which lets me take the next step. and that teaches me something. I if you can just go implement implement implement, fine. There's other workflows that are fine. If you just want to sit there and go learn learn learn, I don't think that works very well, but you certainly don't need TDD.
于是我迈出第一步,从中学到东西,让我能迈出下一步,再学到东西。如果你能不断 implement,也很好,还有其他同样可行的 workflows。如果只是坐在那里不停 learn,我不认为效果很好,但你当然不一定需要 TDD。
It's when you have this rapid alternation between I do a thing, I learn a thing, I do a thing, I learn a thing. That's where TDD is really powerful. But it's not a moral decision. It's a practical decision.
真正适合 TDD 的,是“做一件事、学到一点,再做一件事、再学一点”的快速交替。它不是 moral decision,而是 practical decision。
嘉宾
Test-driven development is one of Kent's most lasting contributions to how software is written and shipped. And today with Agentic development, it's more important than ever. If you work with agents, your job is no longer writing code. It's specifying and testing it. This is where I need to mention our presenting sponsor. Antithesis. Antithesis is the most effective method of verifying a code today. Let me explain how it works.
Test-driven development 是 Kent 对 software 编写与交付方式最持久的贡献之一。今天,在 agentic development 中,它比以往更重要。如果你与 agents 一起工作,你的工作便不再是写代码,而是明确描述并测试代码。这里需要提到我们的主赞助商 Antithesis。 Antithesis 是当今验证 AI code 最有效的方法。
Antithesis runs your whole system in a hostile simulation. By doing so, it finds every bug before your users do. And because the simulation is fully deterministic, antithesis doesn't only find bugs, it gives you a perfect reproduction of every issue. I know this sounds close to science fiction, but it's actually hardcore engineering under the hood.
解释一下它如何工作:Antithesis 会在 hostile simulation 中运行整个 system,以此在 users 遇到 bugs 之前发现每个 bug。而且因为 simulation 完全deterministic,Antithesis 不只找到 bugs,还会为每个 issue 提供完美的 reproduction。