与《代码大全》作者 Steve McConnell 对话:软件工艺、职业发展与AI时代的持久之道 The Pragmatic Engineer 2025-09-10

《代码大全》的诞生:从一篇文章到一个900页的庞大计划

我当时以为这本书肯定已经有人写过了,我希望能找到这本书,这样我就可以用它作为一篇文章的素材。在我的构想中,我打算写一本250页的书。所以,那是我第一次,因为我从未出版过任何东西,我想我应该让它看起来像是我知道自己在做什么。因此,我为这本书制定了一个详细的计划,并估算了书的页数,结果出来是900页。

View/Hide Original English

I thought this book would already have been written by someone and I wanted to see this book so that I could use it as material for an article. In my mind, I was going to write a 250 page book. So, for the first time, I thought since I'd never published anything, I should probably make it look like I knew what I was doing. And so, I created a detailed plan for the book and estimated the page count of the book and it came out to be 900 pages.

《代码大全》是一本关于代码构建的综合性书籍,内容涵盖编码、调试、详细设计、测试等众多主题。它也是内容最详尽的一本,长达惊人的900页。该书的第二版于2004年出版,20年后,它仍然是软件工程领域的畅销书。我在西雅图与该书的作者Steve McConnell进行了一次深入的交流。

View/Hide Original English

Code Complete is a single bus book on code construction which includes coding, debugging, detailed design, testing, and many more topics. It's also the most detailed one with an impressive 900 pages. The second edition of the book was published in 2004 and 20 years later the book remains a bestseller in software engineering. I sat down with the author of the book, Steve McConnell in Seattle.

在这次访谈中,我们探讨了《代码大全》的写作历史,以及出版商当初如何完全没预料到这本书会畅销。我们讨论了软件构建与编码之间的区别,Steve关于软件工程师职业发展的心理模型,以及为什么他认为“荷叶跳跃”式的职业发展是有害的。我们还谈到了人工智能对软件工程的影响,Steve在《代码大全》中未曾提及但现在却深入探讨的主题,以及更多内容。Steve很少接受采访,所以我希望你喜欢这次特别的对话。

View/Hide Original English

In this episode, we get into the history of writing code complete and how the publisher did not expect the book to sell well. The difference between software construction and coding. Steve's mental model of career development for software engineers and why he considers the concept of lily pad hopping harmful. The impact of AI on software engineering topics that Steve left out of code complete but now talks about in-depth and many more. Steve rarely gives interviews so I hope you enjoy this special one.

你写了《代码大全》这本书,当我第一次拿到实体书时,我被它的厚度、广度和深度所震惊。另一个让我惊讶的是,我原以为写这本书的人一定是一位经验极其丰富的技术专家,可能已经工作了二三十年,甚至四十年。但我了解到,你是在职业生涯相对早期写的这本书。你是如何写出来的?你又是如何想到要写这样一本规模宏大、内容详尽的书呢?

View/Hide Original English

So, you wrote this book, Code Completed, and I'm going to show it here. I was amazed when I first got my hands on the physical version on how long it is, how extensive it is and and how thorough it is. And the other big surprise I had, I assume that whoever wrote this must have been a really seasoned tech professional, you know, working 10, 20, probably 30 or 40 years, but I learned that you wrote this somewhat early career. How did you write it? And why did you even come up with the idea of writing such a massive and extensive book?

我最初并不是想写一本书,而是想写一篇文章,而且我从未发表过任何东西。我当时想,我想写作,考虑过写各种各样的东西,而我当时正积极地做着程序员的工作,所以我想,那就写我所了解的东西吧。于是我开始做研究。我是一个很好的研究者,这在今天的背景下听起来很有趣,但在当时,研究意味着要去研究型图书馆,翻阅卡片目录,通过馆际互借来申请资料。那是一个完全不同的过程,而且其中确实需要一些技巧。

View/Hide Original English

So I didn't start out to write a book. I started out to write an article and I'd never published anything. And so I thought uh I I'd wanted to I'd wanted to write and I thought about writing all different kinds of things and I was active as a programmer so I thought write about what you know and uh so I started doing research. I'm a good researcher which is funny in today's context but back then that involved going to a research library and looking through a card catalog and requesting materials through inter library loan. I mean it's quite a different process and uh and so there was actually some skill involved in that.

基本上,我以为这本书已经有人写过了,我想找到这本书,用它来作为我写文章的素材。我基本上就是开始做研究,在阅读了大约80篇文章和几本书之后,我确信这本书并不存在。这让我感到非常困惑,因为当时有关于需求、设计、测试、项目管理的书,但就是没有一本关于程序员主要工作的书,也就是软件构建。

View/Hide Original English

So basically I thought I thought this book would already have been written by someone and I wanted to see this book so that I could use it as material for an article and uh so I I basically just started doing research and after reading about I think I read about 80 articles and a handful of books I convinced myself that this book didn't exist and this was just baffling to me because there were books on requirements design testing project management But there wasn't a book on the main thing that programmers do, which is software construction.

于是我改变了方向。我并没有打算写一本900页的书,那是第一版的篇幅。有趣的是,在我脑海里,我本来打算写一本250页的书,因为我读过的那个领域里所有其他的书都在250到350页之间。我做了背景研究,写了几个样章,准备向出版商提交我的提案。那时我只写了两章。

View/Hide Original English

And so I just kind of shifted gears and I I didn't set out to write a 900page book, which was the first edition. I I I thought, you know, it's funny because in my mind, I was going to write a 250 page book because all the other books I'd read in that space had been 250 to 350 pages. And so I did background research. I wrote a couple sample chapters. I got ready to submit my proposal to the publisher. And at this point, I only had two chapters written.

这是我第一次,因为从未出版过任何东西,我想我应该让它看起来像是我知道自己在做什么。所以我为这本书制定了一个详细的计划,并首次估算了书的页数。结果出来是900页。我心想,这不可能对。我不是在写一本900页的书,我是在写一本250页的书。

View/Hide Original English

And so the f for the first time, I thought since I'd never published anything, I should probably make it look like I knew what I was doing. And so I created a detailed plan for the book and for the first time uh estimated the page count of the book. And it came out to be 900 pages. And I thought that can't possibly be right. I'm not writing a 900page book. I'm writing a 250 page book.

于是我换了一种方式估算,结果是大约875页。我想,好吧,看来我确实在写一本900页的书。关于这件事,我想如果我早一年知道它会是900页,我可能根本就不会有尝试的念头。但到那个时候,我已经投入太多了。我在精神上和情感上都已经完全投入,所以我决定继续做下去。

View/Hide Original English

And so I estimated it a different way and I came up with something like 875 pages. So I thought, okay, I think I'm writing a 900page book. I think the thing about that is that if I had thought a year earlier that it was going to be 900 pages, it never would have occurred to me to even try and uh but by that time I was too far into it. I was mentally and emotionally committed and so I decided to just go ahead and do it.

职业生涯的完美时机

当时你处于职业生涯的哪个阶段,比如工作经验、大学等方面?

View/Hide Original English

and just help us imagine what stage of your career were you, you know, like in terms of work experience, college, those kind of things.

那时我大学毕业大约5年了。我从事专业编程可以说有六年了,因为我在大学期间休了一段时间的学。我其实认为那正是写这本书的绝佳时机,因为我觉得在写书时,对目标读者有一个非常清晰的认识至关重要。对我来说,我的目标读者就是五年前的自己。那段经历还很近,我仍然能清楚地记得五年前的我是什么样子,以及五年前我不知道什么。我想对于一个已经有20或30年职业经验的人来说,这会很难把握。而且,就你需要了解的知识而言,你可能已经过时了。

View/Hide Original English

So, I was about 5 years out uh 5 years out uh of college at that point. Uh I'd been programming professionally for you could call it six years I guess because I took some time off in the middle of college. I actually think that was the perfect time to write the book because I think it's really important in writing a book to have a really clear sense of the target audience. And for me, my target audience was me 5 years earlier. And it was recent enough that I could still remember where I was 5 years earlier and what I didn't know 5 years earlier. I think for somebody who was 20 or 30 years into their career, it'd be really hard to know. Plus, you'd just be out of date in terms of what you needed to know.

意外的畅销书与深远影响

书出版后,它带来了什么样的影响?你还记得最初以及几年后的情况吗?

View/Hide Original English

after the book came out, what was the impact of it? Do you remember like initially and then a couple years later?

是的。书出版后,开始收到非常好的评价。当然,那时的书评都发表在杂志上,人们通过邮寄收到纸质版。那是远在亚马逊出现之前的时代,所以评论是零星地传来的。评论非常好,我在这里的贝尔维尤参加了一个签售会,一位来自微软出版社的人走过来说:“哦,这是我们的黑马书。”我这才知道,他们从未期望这本书能卖得很好。他们决定出版它,是因为他们认为目录里有一本更具学术性、更深入的书会很好看,但他们以为这本书不会真的卖得很好。所以,销量对每个人来说都是一个惊喜。

View/Hide Original English

Yeah. The um so the book came out and it started to get really good reviews and at that time the reviews of course were in magazines which people got in the mail on paper. This is pre Amazon. they trickled in way pre- Amazon and uh and so the reviews were great and I attended a book signing here in Belleview and one of the people from Microsoft Press came in and said uh said, "Oh, this is our sleeper uh book." And uh I learned that they never expected it to actually sell very well. That they decided to publish it because they thought it would be good for the catalog to have a more scholarly uh in-depth book, but they they assumed it wouldn't really sell very well. So uh the sales have been a nice surprise for everybody.

你一定了解到这本书对一个名为“Coding Horror”的博客产生了非常有趣的启发。

View/Hide Original English

You you must have learned about a a really interesting inspiration the book had on the block called Coding Horror.

我不记得具体是什么时候了,大概是2005年左右吧。那是由Jeff Atwood创办的。我想他从一开始就构思了“Coding Horror”。他联系我说:“嘿,我正在写这个博客,我想叫它‘Coding Horror’。我能获得许可使用你书中的‘Coding Horror’图标吗?”我当时就说:“当然可以。”我记得他还送了我一件印有“Coding Horror”图标的T恤。当然,他的博客做得非常非常成功,为他带来了很多好事,我认为也对世界产生了积极的影响。

View/Hide Original English

Huh. I don't remember exactly when it was. It was I don't remember 2005 somewhere in there. Something like that by by Jeff Affwood. He he he started the blog or he re renamed it. I'm not sure. I think he conceived it from the beginning as coding horror. And he reached out to me and said, "Hey, I'm writing this blog. I want to call it coding horror. Can I have permission to use the coding horror icon from your book?" And I was like, "Yeah, sure." And I think he sent me a t-shirt or something with the coding horror uh image on it. And of course his blog did did really really well and uh you know led led to a lot of good things for him and I think had a positive impact on the world too.

我记得在某个时期,它可能是最受欢迎的开发者博客。他曾公布每天大约有10万次请求。我职业生涯早期几乎每天都读Coding Horror。当然,那最终促成了Stack Overflow的诞生,或者说帮助他认识了Joel和其他人,从而创立了Stack Overflow。这真是不可思议,虽然是间接的,但你的书启发了别人创办了一个博客,而这个博客又启发或帮助创建了Stack Overflow这个非常特别的网站。而现在,Stack Overflow显然又帮助训练了一些AI智能体。这一切就像涟漪一样层层传递开来。

View/Hide Original English

I think at some point it might have been the most popular developer blog. He published about something like 100,000 requests per day. I was reading it. So what when I was early career I read coding horror almost like every day or like you know every other day he published an article and then of course that led to stack overflow or or that helped him meet people Joel and and others and that led to Stack Overflow. So it's just kind of incredible how indirectly obviously but you know your book inspired someone else to to start a blog which inspired or or helped create this very special size Stack Overflow which Stack Overflow obviously now has has helped train some of the AI agents. So like it's just all trickling all down.

是的。嗯,我不知道我是否真的相信因果报应,但我绝对相信一个普遍的道理:如果你向世界释放善意,就会产生积极的连锁反应。你永远不知道具体会发生什么,但好事发生的概率可能会比坏事多。听起来,这就是那件事的一部分。

View/Hide Original English

Yeah. Well, I think uh you know, I don't know that I believe in karma literally, but I definitely believe in the general idea that if you put out good things into the world that there are positive ripple effects and you never know what exactly is going to happen, but probably more good things than bad will happen. And so it sounds like that's part of what happened with that.

定义“软件构建”

这本书是关于一个叫做软件构建(Software Construction: 软件开发中专注于代码编写、调试、单元测试和详细设计的阶段)的概念。你在书的开头引用了一段话,你说:“曾几何时,软件开发和编码被认为是同一回事。但随着软件开发生命周期中不同活动的明确划分,该领域一些最优秀的人才花了时间分析和辩论项目管理、需求、设计和测试的方法。他们急于研究这些已明确的领域,却把代码构建当作软件开发中一个被忽视的‘穷亲戚’。”我想问,什么是代码构建?它与软件开发有何不同或相似之处?

View/Hide Original English

And so the book is on the concept called software construction. And and you know, you kind of start the book, I'll I'll quote a little bit from it. You you say at at one time software development and coding were thought to be one and the same but as distinct activities in the software development life cycle have been identified some of the best spines in the field has spent time analyzing and debating methods of project management requirement design and testing they rush to study these identified but it left code construction as the ignorant cousin of software development. I wanted to ask what is code construction? And I mean the book is about code construction but I think it helps us uh recap of and and how it's different to let's say software development or how it's similar to it.

是的,我在书中非常审慎地试图界定软件构建的范畴,这个范畴不同于,或者说不完全等同于编写代码。我认为,直接上手编码可能是你刚开始学习编程时会做的事情。但当你变得更熟练一些时,我认为会有一个中间层次的思考,包括思考如何测试你正在写的东西,思考如何进行细节设计,实际进行编码,以及所有与代码本身相关的议题,比如可读性以及可读性的所有方面。

View/Hide Original English

Yeah, I was pretty deliberate in the book in trying to capture the space of software construction and and a space that's distinct from writing code uh or not distinct from but is not the same as as writing code. Uh I think that the idea of just jumping in and coding is something that maybe you do when you're first learning how to program. Uh but as you get a little bit more advanced, I think there's a level of intermediate thought that includes thinking about how you're going to test what you're writing, thinking about how you're going to design in the details what you're writing, actually doing the coding and then the full set the universe of topics that come to bear on the actual code itself, the readability and the uh all aspects of readability.

我认为在我写《代码大全》之前的大部分文献中,有一些关于编码风格的还不错的东西,但也就仅此而已。它只是编码风格,并没有真正涉及到……我们有关于软件设计的书,但软件设计在很大程度上止步于你进入到曾经的例程(routine)级别,后来实际上是类(class)级别时所需要的设计思维层面。在我看来,似乎有很多思考并没有得到必要的指导,也没有真正发生,尤其是在思考那些与编码相邻、但又不足以大到可以拥有自己独立名称或书籍的活动方面。

View/Hide Original English

I think that that uh much of the literature before I wrote code complete there there were a couple things out there that were decent things on coding style uh but that was kind of it. It was coding style. It wasn't really about you know we had we had books on software design but the software design really stopped short of the level of design thinking that you would get into at uh what would have been at one time the the routine level and then later was really the class level. And it just seemed to me like there was just a lot of thought that wasn't necessarily guided or or necessarily taking place in terms of thinking about the uh activities that are adjacent to coding but not quite big enough to qualify for a book or a name of their own.

我可能会把它的范围界定得比你刚才描述的要窄一些。我认为你刚才描述的一些内容,我可能会将其归类为更高层次的设计。在一个特定的项目中,根据项目的发展或演变方式,设计层面的工作可能在项目开始时就发生,也可能随着你的进展而逐步进行。它可能由擅长那种思维方式的人来完成,也可能由实际执行实现的人来完成。

View/Hide Original English

I would probably make it a little narrower than what you just described. Uh I think that some of what you just described I would probably characterize as a higher level design. uh and uh but on any given project depending on how the project evolves or how it emerges the design level of thing it could happen at the beginning or it could happen incrementally as you go it could happen by somebody who is good at that kind of thinking or it could happen by the people who are actually doing the implementation

两种思维模式:自顶向下与自底向上

我多年来的一个体会是,当我写《代码大全》第一版时我并未真正理解这一点,那就是不同人的大脑工作方式是不同的。有些人确实能够抽象地思考设计,然后实现这个设计;而有些人则非常擅长直接编写代码,从小处吸取教训,然后在此基础上逐步构建。还有些人两者都擅长,但我认为真正两者都擅长的人并不多。我认为更常见的是,你会发现人们擅长其中一种或另一种。

View/Hide Original English

I think one of my learnings over the years and I didn't really understand this when I wrote the first edition of code complete is really that different people's brain brains work differently and some people really are capable of thinking about design abstractly and then implementing the design and some people are really good at just writing the code and learning the lessons in the small and then building up from that and some people are good at both but I don't think a lot of people are actually good at both I think much more commonly you find people who are good at one or the other

然后我认为,在那些在一个领域有能力但在另一个领域没有能力的人之间,常常存在一种脱节。我见过一些情况,人们认为用另一种方式工作是不可能的,因为他们自己做不到,他们无法想象别人能够用那种方式工作。然而,我们有各种各样的实例证明,人们用两种方式工作都能取得很好的结果。

View/Hide Original English

and then I think there's often a disconnect between the people who have ability in one area and not the other. And I've seen cases where people think that it's just not possible to work the other way because they're not able to do it and they just can't imagine that somebody else could be able to work that way and yet we've got all kinds of instance proofs of people working in both ways and having it work out fine.

你能再具体说明一下这两种不同的工作方式吗?

View/Hide Original English

And then the two ways are like so just I understand is is one of like could you just spell out again the the two different ways of of working?

你可以大致将其理解为自顶向下(top-down)与自底向上(bottom-up)。或者你也可以认为是归纳法(inductive)与演绎法(deductive)。我相信大多数程序员,我指的是大多数,不是99%,但可能是51%或70%,他们都非常注重细节。因此,在写《代码大全》时,我做了一个有意识的设计决定,那就是用归纳的方式来写这本书。我不会一开始就提出一堆普适性的陈述,然后再去展示具体细节。我会从讨论大量具体细节开始,然后在结尾处总结出普适性的陈述。我只是觉得,相比之下,更多的程序员更倾向于这种方式。但当时我没有意识到的是,这两种方式之间的鸿沟有多大,以及我认为很多人根本无法以另一种方式运作,无论另一种方式是什么。

View/Hide Original English

You could think of it generally as top down versus bottom up. Mhm. Uh so you could think of it at word inductive versus deductive. Um I believe that most most programmers meaning the majority not like 99% but you know 51% or maybe 70%. I believe most programmers are pretty detail- oriented. And so I made a conscious design decision as I was writing code complete that I would write the book inductively. I wouldn't start out making a bunch of general statements and then demonstrate the specifics. I would start out talking about a lot of specifics and then build up to the general statements at the end. I just felt like more programmers than not were more oriented that direction. But what I didn't appreciate at the time I was writing that was how big the disconnect was and the idea that I think a lot of people just aren't capable of operating the other direction, whichever the other direction is.

设计的非理性与迭代的力量

有一篇非常古老的论文,是Dave Parnes写的,叫做《非理性的设计过程:如何以及为何要伪造它》。这篇论文大概是70年代中期的,非常古老,但其主旨是,设计是一个混乱的过程,没有人能一次就做对。它不是线性的,你不会从起点开始,沿着一条直线走向一个好的设计。所以,首先,这篇论文给了人们实验、尝试、犯错、从错误中学习、迭代的许可。

View/Hide Original English

Yeah, there's a great paper, really old paper by Dave Parnes called the irrational design process, how and why to fake it. And the the gist of the p so this paper is from I think the mid70s. I don't remember exactly. It was a really old paper, but the gist of the paper is that design is a sloppy process and nobody gets it right. It's not linear. You don't start out and march your way in a straight line toward getting a good design. And so number one, the paper sort of gave permission to experiment, try stuff, make mistakes, learn from the mistakes, iterate.

但论文的后半部分,“如何以及为何要伪造它”,说的是在过程结束时,你要描述你做了什么。而这个描述不一定会展示你所有的错误和死胡同等等。所以它看起来会比实际过程更理性。我认为这篇论文的两个部分都值得我们铭记,听起来你的经历也印证了这一点,那就是在大多数情况下,一次就做对几乎是不可能的。

View/Hide Original English

But then then the paper also says the how the how and why to fake it part was at the end of that you describe what you did. And the description is not necessarily going to show you all of the mistakes and dead ends and so on. So it's going to look like it was a more rational process than it was. But um so I think both halves of that paper are are worth keeping in mind and it sounds like your experience would kind of bear that out that it's not even really possible to get it right the first time in most cases.

我记得John Ousterhout在他的书《软件设计的哲学》中建议“设计两次”,因为第二次你会得到比第一次更好的设计。

View/Hide Original English

I think it was John Alistster Sterhout who in in his book on software design a Philadelphia software design his suggestion was design it twice because the second time you'll get a better design than the first time. These are just things that some people might still do but

我会说三次。而且我是认真的。当我在微软的时候,公司内部有一个当时很有名的程序员,他以把所有东西重写三次而闻名。他的基本做法是,如果他有两周时间来完成一项任务,他会花前六天编码,犯各种错误,做得并不好。然后他会把这些全部扔掉,花接下来的三天重写。到那时,他会应用所有学到的教训。然后他会花最后一天或一天半的时间写第三个版本,这个版本会是完美的。

View/Hide Original English

I would say three times but yeah and I'm serious about that. So when I was at Microsoft there was a programmer inside Microsoft who was famous at the time who was well known for rewriting everything three times. And the basic gist of it was if he had two weeks to do an assignment, he would spend the first six days coding and making all kinds of mistakes and not doing it very well. And then he just throw it out and spend the next three days rewriting it. And by that time, he would be applying all the lessons he's learned. Then he'd spend the last day or day and a half writing a third version and it would be perfect.

你想想自己的经历,如果你曾经做了一堆工作,然后不知何故丢失了它——被删除了,你没有备份,等等。理论上这不应该发生,但有时确实会。你会想:“哦,这太糟糕了。我刚花了一整天做这个,现在要花很长时间才能重做。”然后你花了45分钟就重写完了。在重写的过程中,你记起了所有学到的教训,以及所有你希望第一次就做到的事情。结果可能比你从未丢失它,不得不保留最初写的版本还要好。

View/Hide Original English

And you know, if you think about your own experience, if you've ever, you know, this should never happen in theory, but it still happens where you've done a bunch of work and somehow you lose it. It gets deleted. You have a backup, whatever, right? Should never happen, but sometimes it does. And you think, "Oh, this is awful. I just spent a whole day working on this. It's going to take me forever." And then you rewrite it in 45 minutes. And as you go, you remember all the lessons that you learned and all the stuff you wish you'd done the first time. It actually turns out probably better than if you'd never lost it in the first place and had to keep what you wrote initially.

从好奇心到职业承诺

在你写这本书之前和之后,你的职业发展故事是怎样的?之后发生了什么?

View/Hide Original English

So your your career path uh we know that you wrote this book early career. What what was your professional development story up to the book and then after the book? What what happened after?

在写书之前,我曾在一家小型保险咨询公司工作,也曾在一家大型保险公司短暂工作过。我在波音公司参与过一个国防项目,还在一家初创公司工作过,那家公司当时在做一款收缩包装产品。然后,我正准备开始全职写书,却收到了去微软的邀请,最初只是一个夏天。当时微软是最热门的科技公司,所以我想,如果我有机会看看微软内部是什么样子,我应该去,这会让我的书写得更好。结果我在微软待了一年。这基本上就是我的背景。在那段时间里,我一直都有自己的某种创业项目在进行,也投入了大量时间。

View/Hide Original English

Basically up to the book I had worked for a small insurance consulting company. I'd worked for a large briefly for a large insurance company. I had worked at Boeing on a defense project. I'd worked at a startup mode uh for company that was kind of doing a just a startup uh shrink wrap product. And then I was about to start working on the book full-time and I got an offer to go to Microsoft just initially for a summer and I thought h at the time Microsoft was the hot tech company and so I thought yeah if I get a chance to see what's going on inside Microsoft I should do that it'll make my book better. So I ended up being at Microsoft for a year. That was essentially my background. I'd also done I always had some kind of startup project of my own going throughout that that period. uh and you know I put a put a lot of time into those as well.

我一开始对编程有点兴趣,但不是特别感兴趣,尽管我似乎把很多业余时间都花在了上面。起初我只是觉得,我不确定是否想把这个作为一份工作。但后来,我有点创业的倾向,所以在那段时间里我一直在做创业的事情。在某个时刻,我的想法从“我不知道是否真的想把这个作为工作”转变为“如果我要把这个作为工作,我可能应该搞清楚我到底在做什么。”

View/Hide Original English

I had started out being kind of interested in programming but not super interested in it uh notwithstanding the fact that I seem to spend a lot of my essentially hobby time on it anyway. Uh and so I started out just kind of thinking I wasn't really sure if I wanted to do this as a job. And then I thought well but I had a little bit of an entrepreneurial streak so I kept doing startup stuff in that mode. Uh, and I at some point in there I kind of switched over from thinking I don't know if I really want to do this as a job to thinking if I'm going to do this as a job I probably ought to figure out what I'm doing.

我想在最初的几年里,我有点冒名顶替综合症,因为我没有计算机科学的学位。我当时不知道,其实那个时候,在这个领域工作的人中,不到一半的人有计算机科学学位。这种情况很长一段时间都没有改变。但我当时没意识到这很普遍,我以为这很不寻常。所以我开始努力发展或获取一些技能,以便我能更专业。

View/Hide Original English

And I I think at the time for the first couple years I had a little bit of imposttor syndrome because I didn't have a degree in computer science. I didn't know at the time that Oh, really? Oh, well, of course this was What was your degree in in philosophy? Yeah, I had minors in math and computer science, but uh but at the time less than half the people working in the field had degrees in computer science. That didn't change uh for a long time. Uh so I but I didn't realize that I that that was common. I thought that was unusual. So I I started trying to develop or acquire some skills so that I could basically be more more professional.

当我进入微软时,我想,好吧,我终于要看看真正的专业编程是什么样子了,是行业里最好的。当时,微软就像是那只800磅重的大猩猩,没有任何其他公司能望其项背。我不知道他们当时占据了所有软件市场份额的百分之多少,但肯定是一个很高的比例。那大约是Windows和DOS时代的巅峰时期。

View/Hide Original English

And then I got inside Microsoft and I thought, okay, I'm finally going to see what real professional programming looks like, the best of the industry, right? Like Microsoft back then was a bit like what Open AI is now or Google in like 200 I don't know four. It it was just the 800 lb gorilla and there was nothing else even close at the time and uh I don't know what percentage of all software share of the all market software share they had but it had to be a pretty high percentage. This was around the peak right around the wi windows and doss and and that era, right?

我进入微软后发现,第一,那里的人真的非常聪明。这是一个因素。第二,你可能会看到一个人专门负责某一个特定打印机的设备驱动程序。这与我之前的经验截然不同。我之前的经验是,你在一家公司工作,你要负责搞清楚如何打印,如何加载和保存文件,如何把东西显示在屏幕上。而在微软,我发现他们竟然有一个完整的人力,不只是负责打印,而是负责打印到某一个设备。所以,很大程度上就是项目被分解成了非常非常小的部分,人们可以投入更多的时间。而且,是的,他们确实非常聪明。但从编程实践的质量上来说,和我已经见过的并没有什么真正的不同。

View/Hide Original English

So I got inside Microsoft and what I discovered was number one the people were really really smart. So that was a factor. Uh and number two, you had like one person working on the printer device driver for one specific printer. And so the difference between that and my experience was my experience up to that point had been you're working for a company and you've got responsibility for figuring out how to get things to print, figuring out how to load and save files, figuring out how to display stuff on the screen. And it's like, oh, I've got like a whole person, not just on printing, but on printing to one device. So, I mean, that was a lot of it. It's just the the projects were broken down into much much smaller pieces and so people could put a lot more time into it. And then, yeah, they were really really bright. But qualitatively in terms of programming practices, you know, there wasn't really anything different than what I'd already seen.

职业金字塔:一个成长的心理模型

在我写《代码大全》的时候,我还在试图决定我是否真的想成为一名程序员。我花了一年时间全职写《代码大全》,但在此之前,我已经花了两年的时间做背景研究。我休了一年的假。我真的很想写这本书,那是我当时最想做的事情。我知道这是一个大项目,因为那时我已经算出它有900页了。

View/Hide Original English

At the time I wrote code complete, I was still trying to decide if I really wanted to be a programmer at all. And uh if you can believe that and uh and so I'd spent I spent a year full-time writing code complete but I'd spent two years doing background research before I spent the year full-time. I did. I took a year a year off. Yeah, I really wanted to write the book. That was uh that was the main thing I wanted to do by then. And uh and I knew it was a big project because by then I'd figured out it was 900 pages.

写书的过程是一次极好的经历。当时,我觉得通过写这本书,我在一年里获得了三年的经验。我想说,我学到的东西远比写作本身要多得多,思考我想写什么才是主要部分。但之后我回到了亲手编程的岗位,我感觉,哦,这太棒了。我喜欢写作,但我很高兴能再次亲手编程,因为那时我已经有点厌倦写作了。

View/Hide Original English

And at the end of that, uh number one, it was a terrific experience. At the time, I thought I felt like I'd gotten three years of experience in one year by writing the book. I I would I would say I learned so much more about what I was doing just through the process of the the the writing is only not not the main part of it. The thinking about what I wanted to write was the main part of it. But then I went back into hands-on programming role and I felt like, oh, this is great. you know, I like the writing, but I'm so glad I'm doing hands-on programming again because I was kind of sick of the writing at that point.

在我出版《代码大全》的时候,我确信我再也不会写另一本书了。因为那个过程的最后阶段实在是太痛苦了。然后我工作了几年,痛苦的记忆渐渐淡去,我又有点想写点什么了。于是我写了我的第二本书《快速开发》。我一直在反复思考,我更喜欢写作还是更喜欢编程?我似乎更喜欢我当时正在做的事情。花了一段时间,我最终意识到我喜欢这种来回切换,我喜欢这种多样性。但我喜欢的不是每天、每周、每月的多样性,我喜欢有大块的时间来专注、深入地研究一件事。

View/Hide Original English

By the time I published Code Complete, I was convinced I was never going to write another book. And uh because the end phase of that was just painful and uh so then I worked for a couple years and the memory of the pain faded and uh I was kind of getting an itch to write something again. And so then I wrote my second book, Rapid Development. And I kept thinking, I was going back and forth. I kept thinking, do I like writing better? Do I like programming better? I kind of liked whatever I was doing at the time better. It took me a while. Eventually, I realized I liked the back and forth. I like the variety. Um, but not the variety on a day-to-day, week to week, month-to-month basis. I liked having big blocks of time to concentrate, dive in, go really deep.

在我写《快速开发》之前,我开始想,好吧,我想这个编程的事情可能对我来说是个不错的方向,也许我对这个职业有点投入了。所以我开始思考我的职业生涯应该走向何方,我想做什么。我不知道我是怎么想出这个主意的,但我创建了我称之为“职业金字塔”的东西。

View/Hide Original English

So before I wrote rapid development at that point I was starting to think all right yeah I think this programming thing might be a good direction for me and maybe I am a little committed to the career and so I I started to think about where do I think my career should go and what do I want to do and so I have no idea how I came up with the idea but I created what I thought of as the career pyramid

我把软件世界大致组织了一下,金字塔的底部是所有的程序员,大概占100%,我的关注点在美国。往上一层是那些可能真正获得了编程学位的程序员,而我没有。再往上一层可能是拥有编程高级学位,或者写过一些杂志文章,或者担任领导或经理职位的人。总之,金字塔一直向上,直到顶端只有极少数人,他们对这个领域做出了毕生的重大贡献。

View/Hide Original English

and I just I kind of organized the the software for universe into the base of the pyramid was all programmers like 100% of the programmers and my focus was on us and then the second level up was programmers who had maybe actually gotten a degree in programming which I had not and then the next level up was maybe advanced degree in programming or maybe written some magazine articles or were in a lead or manager position and so anyway the pyramid kind of went up to where there were just a very small number of people at the top who had a essentially a lif lifetime of significant contributions to the field.

所以我想,好吧,就设定一个方向而言,我就瞄准金字塔的顶端。这与其说是因为我想达到金字塔的顶端,不如说是为了在地平线上有一个我可以朝着前进的点。我部分地用这个来指导我写第二本书,因为我有很多感兴趣的书想写。在《代码大全》之后,最合乎逻辑的书应该是《设计大全》。我当时可以写,但我觉得如果我那样做,我会被定位成一个纯粹的技术人员。

View/Hide Original English

And so I thought, okay, just in terms of setting a direction, I'll just aim for the top of the pyramid. And it wasn't so much because I thought I wanted to get to the top of the pyramid. It was just more to have a point on the horizon that I could I could move toward. And uh and so I used that partly to guide what I did on the second book because I had a variety of books I I was interested in writing. And uh the the book that would have made the most sense after code complete would have been design complete. Uh I could have written it at the time but I felt like I would get pigeonholed as just pure tech guy if I did that.

另一本我非常想写的书是《Windows性能优化》,这是一个有趣的话题,但同样,它有点太……太偏向于底层技术了。所以我决定跳过去,写一些更偏向管理的东西。因为我想从不同角度逼近金字塔的顶端。

View/Hide Original English

The other book I really wanted to write was performance optimization in Windows. Uh, which was a fun topic, but again it was a little bit too, you know, a little bit too uh, bits and bites. And so I decided to hop over and write something that was a little bit more management oriented. And uh, because I wanted to kind of triangulate on the top of the pyramid

避免“荷叶跳跃”:积累职业价值

你提到了荷叶跳跃(Lily Pad Hopping: 一种职业发展模式,指个人从一个项目或职位跳到另一个,但这些经历之间缺乏关联和积累,无法形成一个连贯、增值的职业路径)的概念。那是什么?你是如何将其应用到你的职业生涯中的?

View/Hide Original English

as as as part of this you you mentioned again in this talk you mentioned the concept of lily pad hopping. What is that and and how did you apply it to your career?

我认为金字塔模型本质上是“荷叶跳跃”的解药。我注意到,后来我注意得更多了,但即使在当时,我也意识到编程感觉不像一个职业,更像一份工作。它感觉像工作而不是职业的原因是,我感觉不到它在走向任何地方。我看到人们做一个项目,然后做下一个项目,再做下一个项目。这就是“荷叶跳跃”的部分。但这些经历并没有累积成任何东西,它只是不同而已,为了不同而不同。

View/Hide Original English

Well, I think that the pyramid was in essence uh the antidote to lily pad hopping. And what I had noticed, I noticed it a lot more later, but even at the time, I'd realized that programming didn't really feel like a career. It felt like a job. And the reason it felt like a a job rather than a career was I didn't get the sense that it was going anywhere. I saw people who'd work on one project and they'd work on the next project, then they'd work on the next project. That's the lily pad hopping part. But it didn't add up to anything. It was just different. It was kind of like difference for the sake of difference.

他们可能在学习新东西,学习新的业务领域,学习新技术。这可能很有趣,也很有启发性,其中肯定有一些个人成长。但我总觉得,如果我要投入努力去学习和成长,我希望它能有所积累。我希望它能累加起来。我不希望它只是一堆不同的东西,而这些东西在某种程度上都是一样的。我真的希望它能大于各部分之和。

View/Hide Original English

And you know, they're probably learning things. They're learning a new business area. They're learning new technology. Uh, and you know, maybe that's interesting and stimulating. And there's some definitely some personal growth that goes on there. But I always felt like if I'm going to put the effort into learning something and growing, I'd like it to to add up. I'd like it to accumulate. I don't want it to just be a bunch of different things that are all the same in a way. I really want it to be essentially more than the sum of the parts.

所以,我当初提出金字塔模型的部分原因,就是想弄清楚,我如何才能摆脱“我做过这个项目,我做过那个项目,我现在知道的东西比以前多了很多,但我的市场价值并没有增加,我的实际价值也没有增加,我在任何单个项目或组织中做出贡献的能力也没有比以前更强”这种困境。所以,我如何才能以一种方式来构建我的技能,使我随着时间的推移变得越来越有价值?无论如何你都要付出同样的努力。这几乎又回到了设计问题上:如果我要付出这么多努力,我可以让它累积成这样,或者我可以让它累积成那样,而如果我花些心思,‘那样’会比‘这样’多得多。

View/Hide Original English

And uh so part of the reason for me coming up with the pyramid in the first place was really just trying to think about okay, how do I get past this idea of I've worked on this project, I've worked on that project, I know a lot more stuff now than I used to, but I'm no more marketable. I'm really no more valuable. I don't have the ability to really contribute on any individual project or organization more than I used to have. So, how do I essentially build my skills in such a way that I become increasingly valuable as time goes by? You know, you're going to put in the same effort either either way. And so, it's almost back to the design question where it's like, if I'm going to put in this much effort, I can either have it add up to this or I can have it add up to that where that is a lot more than this. if I put some thought into it. So

在模糊中成长:从实习生到主人翁心态

大多数人生活在自己为自己建造的盒子里。结构化设计的创始人之一Larry Constantine有一句话我非常喜欢,他说:“没有人需要给你许可才能把你的工作做好。”这句话的推论是,你的经理们已经认为你会做任何需要做的事情来把你的工作做好。他们假定你相信自己有许可去做。与此同时,在基层,很多人生活在他们为自己建造的那个盒子里,他们认为,“哦,我必须用和上次一样的方式来做这件事。”他们这样想毫无理由,我猜这只是人们自我约束的人性使然。

View/Hide Original English

I think that's right. I think uh you know there's the there's saying that most people live in a box that they build for themselves. And uh and then Larry Constantine, who's one of the founders of structure design, if that term even means anything, had a saying that I like, which he says, "Nobody needs to give you permission to do your job well." And and the correlary to that is your managers already think that you're going to do whatever needs to be done to do your job well. They they assume that you believe that you have permission to do it. Meanwhile, on the ground, a lot of people live in that box they built for themselves and they think, "Oh, I got to do this the same way that they did it last time." There's no reason they think that. It's just I guess it's human nature for people to just kind of constrain themselves that way.

所以我认为你完全正确,在我所知道的绝大多数软件工作中,人们都可以在很大程度上设计自己的工作或日常任务,从而以一种更具战略性的方式学习和成长。

View/Hide Original English

So I think you're absolutely right that in the vast majority of software jobs that I've ever been aware of, people can design a lot of their own job or their own day-to-day work in such a way that they can learn a lot and grow a lot in a in a more strategic way.

我第一个带薪的暑期编程工作是实习。基本上,夏天过半我就完成了他们给我安排的所有工作。所以他们不得不给我编造一些事情来做。我的老板给了我一个任务,他递给我一盒软盘,然后说:“我希望你用这盒软盘做点有用的事。”我的反应是:“嗯,你想让我做什么?”他说:“我不知道我想让你做什么。你的工作之一就是搞清楚我应该想让你做什么。所以,你把这个拿走,然后,做点有用的事。”

View/Hide Original English

my first summer job that I got paid for programming as an internship and uh I basically finished all the work they had for me halfway through the summer. So, they had to make up stuff for me to do. And my boss gave me the assignment. He just handed me a box of floppy discets. You have to put up a picture so people know what those are. Oh. And and he said, "I want you to do something useful with this box of discets." And my response was, "Well, what do you want me to do?" and he said, "I don't know what I want you to do. Part of your job is to figure out what I should want you to do. So, you take this away and, you know, do something useful with it."

当时,我感到非常沮丧。我觉得老板没有给我任何授权,没有给我明确的指示。我真的觉得他好像放弃了他作为老板的责任。但随着岁月流逝,当然,到我创办自己的公司时,这基本上成了我99%日常工作的模式。当你自己是公司的老板时,没有人会告诉你下一件最该做的事情是什么。你必须自己弄清楚。事实上,你的主要工作就是审视全局,然后说:“我下一步该做什么?下一件最有用的事是什么?”

View/Hide Original English

And at the time, I was incredibly frustrated. I felt like the boss wasn't delegating anything to me. He wasn't giving me clear direction. I really felt like he'd sort of abdicated his responsibilities as a boss. But as the years went by and certainly by the time I started my own company, that was basically the model for 99% of my day, which is nobody nobody when you're the owner of your company tells you what the next most useful thing to do is. You got to figure that out. In fact, it's really mainly your job to be the one who's looking at the whole landscape and saying, "What do I do next? What's the next most useful thing to do?"

所以,是的,我完全同意并认同这一点。有趣的是,作为一个初级员工,你会觉得任务中的模糊性是一个真正的缺点,但实际上,当你进入更高责任的职位时,这对于你处理的事情来说是极其宝贵的训练。当我说责任时,我不仅仅是指对人的责任,我还指产品方向、组织健康等各种各样的事情。

View/Hide Original English

So, yeah, I I completely uh agree with that and identify with it. And it's funny how as a junior person, you can feel like the ambiguity in that assignment is a real liability, but really that's incredibly valuable training for what you deal with as you get into higher positions of responsibility. And when I say responsibility, I'm not just talking about for people. I'm talking about product direction, health of the organization, uh, all kinds of stuff

公司演进:从初创到成熟

当你说到这个时,我想到的是,我认为公司会经历一个成熟的过程。在这种情况下,我说成熟,甚至不是说越成熟越好。有时候,不那么成熟反而更好。但有些性格的人在初创模式下工作得很好,而另一些性格的人则在进入缓慢增长或维持模式时工作得更好。

View/Hide Original English

Well, what comes to my mind when you say that is I think companies go through uh maturing process. When I say maturing in this case, I'm not even saying more mature is better than less mature. Sometimes less mature is better, but you have certain personalities that work well in startup mode and you have other personalities that work better as you get into slow growth or sustaining mode.

你所描述的情况,我认为在大多数员工都是自我激励、自我驱动,并且他们是令人兴奋的事业的一部分,公司在成长,他们可能很年轻,可能是刚从学校毕业或毕业几年的时候,是非常棒的。在这种模式下,你可以做很多事情。随着公司变大,有了固定的客户群,其他公司开始做一些严重依赖其可靠性而不仅仅是创新的事情时,他们需要不同的东西。他们不再需要最新、最棒、最酷的东西,他们需要东西能像昨天一样工作,因为他们已经基于此做出了假设。

View/Hide Original English

And so what you described I think is just is great when you've got most of the staff that's self-motivated, self-driven, and they're part of something exciting and it's growing and they're probably young and they're probably hired directly out of school or a couple years out of school. There's a lot you can do in that mode. As the company gets bigger, as it gets installed client-based, as companies start to other companies start to do things that rely heavily on the reliability, not just the innovation, but they they need different things. They don't they no longer need what's latest and greatest and coolest. They need the thing to work the same way it did yesterday because they've made assumptions that depend on it.

然后,你基本上就需要一种不同类型的员工来做这件事。所以,随着时间的推移,一些早期贡献最大的员工会因为所有的限制而感到厌倦和沮丧,然后他们会离开。而所有那些角色中的模糊性或灵活性,就不再是积极因素了。

View/Hide Original English

Then you get essentially you're calling for a different kind of staff to work on that. So, as time goes by, some of the staff that were the biggest contributors early on get bored and frustrated with all the restrictions and they leave and then all that uh ambiguity or flexibility in the roles and stuff. Uh that's no longer a positive.

所以我对你描述的场景的预测是,10年后,那个组织将需要我公司所说的“角色与责任”研讨会。因为这种情况太常见了,你以一种有效的方式开始,但当你发展到一定规模,员工的特点也发生变化时,这种方式就不再奏效了。所以你需要对此更加明确。我认为这些都只是随着时间推移发生的自然钟摆效应。并不是说一种比另一种更好或更坏,而是要适合目的。在初创模式下,拥有大量官僚主义是永远无法起步的绝佳配方。但在某个时刻,增加适度的官僚主义对于维持一个更大规模的组织是必要的。

View/Hide Original English

And so my prediction with the scenario you described is that 10 years from now that organization will need what my company called a roles and responsibilities workshop because it's just so common that you start out in a way that that works. But you get to a point where as things scale up and as the character characteristics of the staff change, it just doesn't work anymore. And uh and so you just need to be a little bit more explicit about about it. And I think these, you know, these are all just natural pendulum swings that happen as time goes by. And it's not that one is better or worse than the other. It's really fit for purpose which in startup mode you know having a lot of bureaucracy in startup mode is a great recipe for never getting started. Uh but adding the right kind of bureaucracy at some point becomes necessary to sustain a an organization of of a larger size.

有一种模型,我不知道是谁提出的,但它提到了先驱者、定居者和城市建设者(Pioneer, Settler, and City Builder: 一种描述组织或个人在不同发展阶段角色的模型。先驱者探索新领域,定居者在已验证的领域建立基础,城市建设者则负责规模化和优化现有系统)。这也算是你所说的一种变体。

View/Hide Original English

And one model I've heard which I I don't know who to attribute it to, but there's the pioneer settler and citybuilder. Yeah. Which which also is one variation of what you said.

三大知识支柱与职业路径选择

你曾概述了软件开发者应该精通的三个领域:技术知识、业务领域知识和软件最佳实践知识。根据你的经验,这些有多重要?你如何才能在这些方面做得更好?如果你必须判断,随着开发者经验的增长,哪些变得更重要?

View/Hide Original English

you you outlined three areas that you've noticed that software developers should become proficient in technology knowledge business domain knowledge and software best practices knowledge in your experience like how important are these and how how can you get good at them and and if if you had to you know take a stab at which ones are becoming more important as a developer is getting more experience which in your experience which one was, you know, like one more important either for you or the people you work with.

它们在任何时候都在某种程度上都很重要。如果你是一个初级开发者,你可能在所有这些方面都不太擅长,但你可能在技术领域最强。如果你是一个稍微资深一点的开发者,比如你在同一家公司工作了五年,那么除了在技术方面很强之外,你在软件最佳实践或业务方面也可能很强。五年在软件世界里是一段很长的时间。

View/Hide Original English

They all matter to some degree at all times. Uh if you're a junior developer, you're not very good at all of them or any of them, but you're probably the strongest in the technology area. uh if you're a little bit less junior developer, you know, maybe you've worked for the same company for uh five years, then you could be pretty strong in the software best practices or pretty strong in the business in addition to being pretty strong on the technology side. I mean, five years is a long time in the software world.

在某个时刻,我见过的绝大多数软件专业人士最终都会专注于一个或另一个领域。所以我认为,除非你身处一个技术性超强的组织,否则最限制职业发展的做法就是完全投入到技术方面。在某些地方,这可能会奏效,但那是例外。

View/Hide Original English

At some point, the vast majority of software professionals I've ever met, they end up concentrating in in one area or another. And so I think the most careerlimiting unless you're in just a super techy organization is to to just go all in on the technology side. There are some places where that's going to work, but it's that's the exception.

全身心投入业务领域是进入更高级别的公司级架构师角色的一个非常好的背景。你了解不同部分如何为技术和业务服务而结合在一起,你能够基于业务来做技术决策,而没有多少人擅长这个,所以我认为这可能是一条非常有价值、有用的职业道路。

View/Hide Original English

Uh going all in on the business side is a really good background for moving into more of a like company level architect role. You understand how the different pieces fit together for both the technology and the business. you're able to to make technical decisions on a business basis and not very many people are good at that and so I think that can be that can be super valuable useful career path.

最佳实践路径,也就是我的路径,在绝大多数公司里实际上可能更受限制。如果你是顾问或培训师,限制会少一些,但在公司内部,你仍然可以很有价值,但你可能会转向更偏向教练的角色,或者可能转向更偏向经理的角色。

View/Hide Original English

The best practices path which is my path is actually probably a little bit more limited in the vast majority of companies. It's less limited if you're a consultant or a trainer, but uh inside a company, you know, you can still be valuable, but you're probably going to move into more of a coach role or possibly move move into more of a manager role.

无论如何,我认为后两种专注领域中的任何一个都可以是可行且有价值的专注路径。而且我认为,我在那次演讲中提到的一件事是,仔细思考你想成为哪一种人是非常有用的。我不知道有很多人真的会去想这个问题。他们得到一个成为经理的机会,他们就觉得,好吧,这似乎是升职了。他们不一定意识到,哦,是的,如果我走经理路线,随之而来的是我需要在人际交往方面做得更好,然后我还需要在业务方面做得更好。

View/Hide Original English

Anyway, I think either of those either of those second focus areas can be uh viable and valuable uh paths to focus on. Um, and I think one thing I mentioned in that talk was uh that it's just it's very useful to think through which one do you want to be? And I I don't know that a lot of people actually think about it that much. They kind of they get an opportunity to be a manager. And so they're like, okay, that seems like a step up. And they don't necessarily realize, oh yeah, if I take the manager path, part of what goes with that is I need to get better at the people side of it, and then I also need to get better at the business side of it.

如果我在经理的道路上走得足够高,在某个时刻,业务需求会与技术需求发生冲突,而我的角色将要求我偏向于业务的需求。很多技术人员无法完成这种转变,因为他们太执着于技术,他们无法想象业务会优先于“最好”的技术决策。

View/Hide Original English

If I go high enough on the manager path, at some point the business needs come into conflict with the technology needs and my role is going to require me to favor the be the needs of the business. And a lot of technical people can't make that transition because they're too wedded to the technology and they just can't conceive of the idea that the business would take precedence over the best, you know, that's in quotes, the best technical decision.

技术人员的管理之路

对于技术人员转管理,我认为有一个相当普遍的模式:他们进入管理岗位一两年,然后决定自己不喜欢,于是回到技术贡献者的角色,享受其中,但又会回过头来思考,嗯,我本可以这样或那样做管理工作。然后他们会第二次尝试做经理,这次他们就真的喜欢上了,并且做得很好。我见过很多次这种模式。所以,这种碰壁、回来、重整旗鼓,几年后再做第二次尝试的想法是存在的。其中一些人最终会成为非常非常有效的管理者。

View/Hide Original English

One is that I think a pretty common pattern for technical staff is going into management for a year or two, deciding they don't like it, going back into a technical contributor role, enjoying it, but going back to thinking about, huh, here I could have done the management thing this way, I could have done it that way, and then they make a second attempt at manager, and then they actually really like it and they do well. I've seen that pattern many times. Uh, and so just the idea of kind of bouncing up against the ceiling, coming back, regrouping, and then taking a second run at it a few years later. And some of those people end up being really, really effective managers.

另一个我发现非常不寻常的特点是,大多数任何级别的技术经理都没有晋升到综合管理职位的愿望。如果你担任技术副总裁或软件副总裁的角色,你不太可能渴望成为CEO或COO。如果你有任何渴望,那很可能是渴望在一家更酷的公司担任技术副总裁的角色。仅此而已。这很有趣,因为我认为对于一般的商务人士来说,这真的很难理解。他们会想,嘿,如果我是副总裁,我想成为CEO,我想进入C级别。但无论出于什么原因,我不认为技术人员会那样想。我在技术领域之外没有读到过这种情况。

View/Hide Original English

Another attribute that I find to be really uncommon is that most technical managers at any level don't have any aspiration to general management positions. If you're at a VP of technology role, VP of software role, it's unlikely that you aspire to be the CEO or the COO. What's likely, if you aspire to anything, is you aspire to having the VP technology role at a cooler company. Uh, and that's it. And so, it's funny because I think for uh general business people, this doesn't really compute. You know, they like, hey, if I'm a VP, I want to be the CEO. I want to move into the sea level. But for whatever reason, I don't think technical people think that way. I don't read about it outside technology.

个人能量:被低估的成功要素

我认为值得一提的一个话题是,专注地运用个人能量可以弥补许多其他方面的不足。在初创模式下,当你谈论没有明确界定的角色等等时,如果每个人都以专注的方式工作,关心完成工作,并投入大量精力,那么错误就不是什么大问题。你只要进去把它修好就行了,因为你有精力去做。

View/Hide Original English

a topic that I I don't think I've ever written about uh but that I think is worth just throwing on the table is that and it is that focused application of personal energy makes up for a lot of other deficiencies and and in startup mode when you're talking about not having well- definfined roles and so on. If everybody's actually working in a focused way and they care about getting work done and they're applying a lot of energy, you know, mistakes aren't a big deal. You just go in and you fix it because you've got the energy to do it.

如果你以一种非常注重流程的方式工作,人们一半心思在想家里的事,他们心不在焉,因为现在他们45岁而不是27岁。并不是说这是一种普遍模式,但如果你没有同样水平的个人精力来纠正错误,错误就会持续存在,影响更多的人,影响更多的下游产品和工作成果,这就会变成一个大得多的问题。

View/Hide Original English

If you're working in a super processoriented way and people are kind of thinking half about their home life and they're checked out because now they're 45 instead of 27. Not that that's a universal pattern or anything, but um but you know, if you don't have the the same level of personal energy to correct mistakes, the mistakes linger, they affect more people, uh affect more downstream products, work products and and it just becomes a much bigger deal.

当我在微软时,核心的Windows团队不到15人。当然,那是Windows的早期版本。但当时,IBM有一个项目正在进行。微软和IBM当时正在联合开发一个名为OS/2的操作系统,IBM的员工数量大概是微软的10倍,甚至更多。微软对IBM在他们那边的进展缓慢感到非常沮丧。现实是,你可以用合适的10个超级专注的人完成很多事情。

View/Hide Original English

And you know, when I was at Microsoft, the core Windows team was under 15 people. And of course this was you know much earlier version of Windows but uh at the time there was a project going on at at IBM. Well Microsoft and IBM were jointly developing operating system called OS2 and IBM had something like 10 times the staff maybe more than that and Microsoft was really frustrated at how slow IBM was on their side. And the the reality is you can get a lot of stuff done with the right 10 people who are all super focused.

你可以用高水平的精力完成非常多的事情,但在技术领域,我没有读到过多少关于人们讨论精力所扮演的角色的文章。一切都关乎流程、培训你的不同人员的技术等等。

View/Hide Original English

so yeah you can get an awful lot done with the right with a high level of energy and I don't think in the technical space I haven't read much at all on people talking about the role that energy plays it's all about process and uh training your training your different people in technology and so on.

在我曾在微软工作的那个时代,我认为那里的文化是,只要你醒着,你就在工作。从外部看,这像是一个血汗工厂,但从内部看,他们当时在招聘那些除了想开发下一代软件之外什么都不想做的人方面做得非常出色。那是一个非常棒的时期,因为你感觉自己至少比世界其他地方领先一年。

View/Hide Original English

And so during the era I was at Microsoft I think uh the the culture at Microsoft when I was there was if you were awake you were working. And the thing that it looks from the outside like it's a sweat shop, but from the inside it's just they were doing an incredible job at that time of hiring people who really didn't want to do anything other than work on the next generation of software. And it was a great time to be there because you felt like you were at least a year ahead of the rest of the world

你无法通过好的管理来复制这一点,仅仅试图以某种方式激励人们愿意在他们醒着的时间里100%地工作。你真的必须把各个部分都安排好,让人们自己愿意这样做。如果你是一家像当时微软那样的超级知名公司,那么这一切就会自然而然地发生。管理者的工作真的就是不要把事情搞砸。但如果你只是一家普通的企业或处于维持模式的公司,我认为在这些公司里是不可能复制的。

View/Hide Original English

But you can't replicate that through good management. Yeah. Uh where you're just trying to somehow motivate people to want to work 100% of their waking hours. You really have to just put the pieces in place so that people want to do it. And if you're if you're a a super high marquee company like Microsoft I was at that time, then you know it happens kind of automatically. Really the manager's job is not to mess it up. But if you're a regular just business or a sustaining mode company, I don't think it's possible to replicate in those companies.

冲刺与恢复:可持续的职业节奏

我们公司最初在敏捷出现之前,就开始考虑每周40小时工作制。但我雇佣的第一个人,他后来做了20年的CTO,最终我和他都意识到,我们俩谁也没在每周40小时的工作周里工作过。我们都天生以冲刺模式工作,而且我们在冲刺模式下工作效率最高。所以,这无关乎保持一个稳定状态,而在于拥有一个可持续的模式。

View/Hide Original English

We originally as a company really before agile existed uh had started out thinking 40hour work week. But the first guy that I hired uh who uh ended up being the CTO for 20 years, um eventually he and I realized neither of us had ever worked in a 40-hour work week. We both naturally worked in burst mode and we both did our best work in burst mode. And so it's not about having a steady state. It's about having a sustainable pattern.

你所描述的,我百分之百感同身受,那就是你不想一直都这样,但如果你整个职业生涯都从未经历过那种状态,我会真的觉得我错过了什么。

View/Hide Original English

Uh and you know what you described I resonates with me 100% in that you don't want it all the time but yeah if you had to go through your whole career and never experience that I would really feel like I had missed out on something if I I couldn't have been in that mode at least some.

20年后回望《代码大全》

你提到有一个你没有写但事后看来可能是一个好主意的话题,那就是能量的作用。我想问你,自从第二版出版以来,那也一定有20多年了。如果今天你写这本书,你可能会加入哪些其他一两个主题?

View/Hide Original English

So you mentioned that one topic you you didn't write about but maybe it could could have been a good idea in hindsight is rule of energy. I wanted to ask you since you know the the since the second edition has been published and that must have been 20some years as well. Uh what are what is are one or two other topics that you know if you wrote this book today you might have added into it?

是的。我认为这确实触及了我现在职业生涯的局限性,我确实已经好几年没有在《代码大全》这个层面上活跃于软件领域了。具有讽刺意味的是,过去五年里,我花在亲手编程上的时间,仅仅是为了个人使用,比我之前大概15年加起来还要多。但那真的只是我个人做的一人项目。

View/Hide Original English

Yeah. So I think that that really gets into the limitation of where I am professionally now and and I really have not been active in software at the code complete level um for several years now. I mean the irony of it is I've spent more time actually doing hands-on programming just for my personal use the last five years than I did for probably 15 years before that. But it's really just one person project me personally doing it.

我认为《代码大全》第二版的一个非常成功之处在于,它确实是第二版,我在第一版出版11年后才出版它。所以我认为那是两个版本之间理想的时间间隔,因为在中间的10年里我学到了很多。我认为行业也成熟了很多。当我回去开始做第二版时,我有一个很好的视角来审视自第一版以来发生了什么变化,并真正思考,这对于哪些东西是短暂的,给了我什么样的洞见。这本书的全部意义就在于试图捕捉那些能够跨越技术代际、跨越编程语言的、更长寿的最佳实践。

View/Hide Original English

Um I think uh you know we've talked quite a bit in this conversation about design three times and I think one one thing that has worked out really well for code complete second edition is really that it is the second edition and then I I published it 11 years after the first edition and so I think that was that was really kind of an ideal amount of time between the two editions because I had learned a lot in the intervening 10 years. the industry I think had matured quite a lot and when I went back and started working on the second edition I had a great vantage point for looking at okay what has changed since the first edition and really thinking through well what insights does that give me about the kinds of things that are shorterd and the whole point of the book was to try to capture the longer lived best practices that would span te uh generations of technology and span programming languages and so on.

所以,在第一版和第二版之间的10年里,第一版里有些东西,就像,是的,好吧,这个真的不持久,需要去掉。还有些东西,就像,哇,10年过去了,这个真的没怎么变。我认为当第二版在2004年出版时,敏捷(Agile)真的已经超出了婴儿期,当时大概处于蹒跚学步的阶段,也许还要更成熟一点,但我们当时仍然主要关注XP(极限编程)。Scrum(一种敏捷开发框架)当时还没有真正成为主导实践。

View/Hide Original English

So the 10 years between those two, there was some stuff in the first edition, it's like, yeah, okay, this really wasn't lasting. This needs to go. There was other stuff it's like, wow, you know, it's been 10 years. This really hasn't changed much at all. And uh I think when the second edition came out in in uh 2004, agile was really it was beyond infancy. It was kind of at the toddler stage at that point, maybe a little beyond that, but we were still mostly focused on on XP. scrum really hadn't hadn't uh emerged as the the dominant practice at that point.

我觉得第一版在10年里的老化程度比第二版在20年里的老化程度还要大。

View/Hide Original English

So I feel like the first edition had aged more in 10 years than the second edition has aged in 20 years.

AI 革命:新工具还是根本性转变?

如果你是这个行业的一名早期职业人士,看到有这样一种工具能很好地生成代码,虽然不完美,但能生成相当不错的代码,你会如何思考,以便充分利用它来发展你的职业生涯,理解如何驾驭它,以及这可能会如何改变软件开发?

View/Hide Original English

If you were, you know, like an early career professional in in in this industry, seeing that there's this tool that is actually good at spitting out code, not perfectly, but pretty good code, how would you think of making the most uh out of it for for your career for to to understand how how to tame this and and how how this might even change software development if it if it will. Maybe it won't.

嗯,我认为很明显它会改变。但我认为它将如何改变则完全不清楚。在我看来,我们仍处于如何使用任何类型的AI来辅助软件开发,或者说辅助任何事情的非常早期阶段。我认为,在目前这个时间点,我学到的教训是,你设置的护栏越多,你得到的结果就越好。

View/Hide Original English

Yeah. Well, I think it's pretty clear it will. Uh I think it's totally unclear how how it will. In my mind, we're still in the pretty early stages of of how we would use any kind of AI for help with software development or really for help with anything. I think, you know, at this point in time, the lessons I feel like I've learned are the more guard rails you put in place, the better result you're going to get.

昨天LinkedIn上有一个有趣的帖子,有人说,关于在软件中使用AI的经验教训是,你必须对你的需求非常清楚,你必须很好地定义你的测试用例,你必须很好地定义所有的异常情况。帖子的主旨是,哈,这听起来就像是好的软件开发基础。而现在,AI是那个在75年后终于迫使我们这么做的东西。

View/Hide Original English

There was a funny LinkedIn post yesterday from somebody who said the learnings about using uh AI and software are you've got to be really clear about your requirements. You've got to really define your test cases well. you've got to define uh uh all the exception cases really well and the gist of it was huh this just sounds like good software development fundamentals and uh only we are now you know AI is the thing that's finally after 75 years forcing us to do this

我的另一个感觉是,我认为编写代码的黄金路径或快乐路径一直都是编码中最容易的部分。而理解我忘记了哪些异常情况,或者我不知道的,或者需求从未捕捉到的。Fred Brooks发表了一篇名为《没有银弹》的论文,他谈到了偶然复杂性与本质复杂性(Accidental vs. Essential Complexity: 偶然复杂性指由我们使用的工具或方法引入的、可以被消除的复杂性;本质复杂性则指问题本身固有的、无法避免的复杂性)之间的区别。很多本质复杂性来自现实世界,因为现实世界是混乱的。

View/Hide Original English

my other feeling is that I think writing the gold path or the happy path through the code has always been the easy part of coding. And you know, understanding which which exception cases did I forget about or was I unaware of or did the requirements never capture in the first place. uh you know Fred Brooks published a paper called no silver bullets and he talks about the difference between accidental complexity and essential complexity and a lot of the essential complexity comes from the real world because the real world is messy

在某种程度上,如果AI没有与现实世界的混乱完全对齐,那么程序员作为全面审查所有异常情况、边界情况、差一错误等的一方,其工作仍然存在。另一件令人担忧的事情是,我仍然认为AI不会数数,所以差一错误似乎很可能……

View/Hide Original English

and to the degree that uh AI isn't 100% lined up with the the messiness of the real world then the programmer job of being the party that fully vets all of the exception cases and the corner cases and the off by ones and so on. That's the other thing that's concerning is I still think AI can't count and so off by one errors seem like they're just probably

是的。所以,有时候程序员在开始时会遇到困难。你提到了伪代码编程过程,我认为AI在这方面可以非常有帮助。你可以说,嘿,看,我设计这个时应该考虑哪些步骤?哪些不同的主题我应该考虑?什么样的顺序是合理的?你基本上可以进行对话,说,给我这个空间的分解,向我展示类设计会是什么样子。好吧,我不喜欢那个,给我一个不同的分解,向我展示那个会是什么样子。这种能够超快速迭代,并将你自己的大脑插入到这些迭代中的能力,我认为非常有价值。而且,就此而言,作为这个循环中的人类,这是非常具有启发性的。然后,当然,你也可以问,我应该考虑哪些测试用例?你可以让它与自己对抗。我认为,至少我自己的经验是,我没有在任何超级复杂的事情上尝试过,但我觉得这个基本概念是行得通的。

View/Hide Original English

Yeah. So uh sometimes programmers have difficulty just getting started. You mentioned the pseudo code programming process. I think that's something where AI can be pretty helpful. your hey look what are the the steps I should what are the different uh topics I should consider when I'm designing this okay what sequence would make sense you you can basically dialogue and say you know give me a a breakdown of this space and show me what the class design would look like okay I don't like that give me a different breakdown show me what that would look like the ability to iterate super quickly and and insert your own brain into those iterations I think is incredibly valuable and for that matter It's incredibly stimulating to be the human in that in that loop. And then of course you can also say what test cases should I consider you know you can kind of pit it against itself and and I think at least my own experience with that is you know I haven't tried it on anything super complicated but I think the general concept seems to work.

我认为编程的历史是一部不断增加聚合层次的历史。你从汇编或机器语言开始,然后聚合到汇编语言,这是一个聚合层次。然后你聚合到宏汇编,这是第二个聚合层次。然后你有了一个叫做子程序的惊人发明,这是可调用功能的聚合。然后你聚合到类,这是数据和功能的组合。然后,我不知道,它就有点……至少那是我直接参与的知识停止的地方。

View/Hide Original English

I think the history of programming is a history of increasing levels of aggregation. So you started out with assembly or machine language and then you had aggregation into assembly and that was one level of aggregation. Then you had aggregation into macro assembly. So as a second level of aggregation then you had this amazing invention called the subruine which was an aggregation of callable functionality and then you had an aggregation into classes where you had a combination of data and functionality and then I don't know it kind of you know at least that's kind of where my knowledge of it my direct involvement of it kind of stopped

也许吧,但别忘了,我认为我们俩都没提到的一个巨大差异是,AI与之前所有的一切都不同,它是非确定性的(Non-deterministic: 指一个系统或过程,对于相同的输入,可能会产生不同的输出,其行为无法被精确预测)。在编程中,我们已经习惯了,并且我认为我们已经非常擅长利用确定性。而非确定性总是有其危险和缺陷,它更难处理。

View/Hide Original English

Well maybe but you know don't forget one thing that I think we just didn't neither of us mentioned a huge difference with AI and everything else that came before it is it's non-deterministic. Yeah. And in programming we have been used to and I think we've gotten really good at making the most of deterministic. And nondeterminism always has its its dangers it its flaws. it's uh it's it's harder to work with

给工程师的持久职业建议

你对工程师如何拥有一个持久的职业生涯有什么建议?那些对你有效的、可能与技术无关的原则是什么?

View/Hide Original English

What suggestions would you have for an engineer to have a durable career principles that that worked for you probably independent of of technology?

当我写这本书的第一版时,我努力牢记的一件事是,写书的指导原则,以及回答每一个问题的原则是:这是否让这本书对读者更有价值?有些东西我可能很喜欢,但可能对我个人来说是特有的。我最终决定,那不会让它对读者更有价值,所以我把它们删掉了。书的设计元素、书的内容,一切都关乎什么能让这本书对读者更有价值。当我在写书的过程中不断迭代这个想法时,我认为带着这个想法的迭代,最终累积成了一些东西。

View/Hide Original English

When I was writing the first edition of the book, um, one of the things I tried to keep firmly in mind was that the guiding principle for writing the book and the principle that answered every question was, does this make the book more valuable for the reader? And so there were some things that I kind of liked but maybe were idiosyncratic to me. I ultimately decided that doesn't make it more valuable for the reader. So I I left them out. um design elements of the book, content of the book, everything was about what makes this more valuable for the reader. And as I iterated on that over the course of writing the book, I think that iteration with that in mind, just add it up to something.

我的职业建议也完全一样。什么能让你对你的组织或整个世界更有价值?并不是说如果有人不这么想,我就会认为他是个坏人。但如果你做的每件事都只是为了满足一些个人癖好,那是特立独行的,你对它感兴趣,但它并没有累积成任何东西。只要意识到,那是一个失去的机会。

View/Hide Original English

And uh I think the same thing would my career advice would be exactly the same. What makes you more valuable to your organization or to the world at large? And you know, it's not like anybody I would think someone's a bad person if they don't think that way. But if everything you're doing is just to scratch some personal itch, it's idiosyncratic. You're interested in it, but it doesn't add up to something. Just be aware that that's, you know, that's a a lost opportunity.

另一方面,每当你思考,嗯,我下一个应该做什么项目?我下一步在组织里想做什么?有时候你没有选择,有时候你可以在选项A和选项B之间做出选择。选项B是否可能比选项A打开更多的门?嗯,也许你应该因此选择选项B。其中一个是否让你更有价值?嗯,为此选择它。我认为这不仅仅是关于个人发展或个人成功,这是关于让世界变得更好。如果你让自己变得更有价值,你就在增加你为世界做出贡献的能力。我认为这是一件有益的事情。

View/Hide Original English

And if on the other hand, every time you think about, well, what project should I do next? What do I want to do next in the organization? Sometimes you don't get a choice. Sometimes you do get a choice between option A and option B. Does option B open up more doors possibly than option A? Well, maybe you should choose option B for that reason. Does one of them make you more valuable? Uh, you know, choose it for that reason. And I don't think this is just about personal development or personal success. I think it's about making the world better. If you're making yourself more valuable, you're increasing your ability to contribute to the world. And uh and I think that's a virtuous thing.

是的,你在书的结尾强调了工艺(craftsmanship)对于专业成长的重要性,你写道好奇心和持续学习是优秀软件工程师的基本特质。对我来说,这感觉和以往一样重要。

View/Hide Original English

Yeah. And you close the book with with the how you emphasize how craftsmanship is important for professional growth and you you you write how curiosity, continuous learning are essential trait of great software engineers and to me that it feels this is just as relevant as ever.

我认为这只是人类经验的一部分。而且我认为,程序员可能比一般人更好奇,他们喜欢学习,被新奇事物所吸引,想学习什么是新的、什么是酷的,想探索用新的、酷的东西能做什么。我们今天关于AI的很多对话,都是关于探索用新的、酷的东西能做什么。我认为程序员就是这样的人,我不会改变这一点。

View/Hide Original English

I just think it's it's part of the human experience. And I think that programmers probably more than average are curious people who like to learn, who are attracted to novelty, who want to learn what's new and what's cool, and who want to explore what's possible with what's new and cool. A lot of our conversation today about AI has been all about exploring what's possible with what's new and cool. I think this is just the way programmers are and and I wouldn't change that.