《Software Engineering at Google》摘抄(10)

by kevin 29. 九月 2022 08:28 >
Instead, before you begin writing, you should (formally or informally) identify the audience(s) your documents need to satisfy. A design document might need to persuade decision makers. A tutorial might need to provide very explicit instructions to someone utterly unfamiliar with your codebase. An API might need to provide complete and accurate reference information for any users of that API, be they experts or novices. Always try to identify a primary audience and write to that audience.(相反,在你开始写作之前,你应该(正式地或非正式地)确定你的文件需要满足的受众。设计文档可能需要说服决策者。教程可能需要为完全不熟悉你的代码库的人提供非常明确的说明。API可能需要为该API的任何用户(无论是专家还是新手)提供完整准确的参考信息。始终尝试确定主要受众并为该受众写作。) In some cases, different audiences require different writing styles, but in most cases, the trick is to write in a way that applies as broadly to your different audience groups as possible. Often, you will need to explain a complex topic to both an expert and a novice. Writing for the expert with domain knowledge may allow you to cut corners, but you’ll confuse the novice; conversely, explaining everything in detail to the novice will doubtless annoy the expert.(在某些情况下,不同的受众需要不同的写作风格,但在大多数情况下,技巧是以一种尽可能广泛地适用于不同受众群体的方式进行写作。通常,你需要同时向专家和新手解释一个复杂的主题。为有领域知识的专家写作方式可能会让你少走弯路,但你会让新手感到困惑;反之,向新手详细解释一切无疑会让专家感到厌烦。) A good design document should cover the goals of the design, its implementation strategy, and propose key design decisions with an emphasis on their individual trade-offs. The best design documents suggest design goals and cover alternative designs, denoting their strong and weak points.(一个好的设计文档应该包括设计目标、实施策略,并提出关键的设计决策,重点放在它们各自的权衡上。最好的设计文档建议设计目标,涵盖替代设计,指出其优缺点。) Importantly, if documentation is tied into the engineering workflow, it will often improve over time. Most documents at Google now implicitly go through an audience review because at some point, their audience will be using them, and hopefully letting you know when they aren’t working (via bugs or other forms of feedback).(重要的是,如果文档与工程工作流程联系在一起,它往往会随着时间的推移而改进。现在,谷歌的大多数文档都隐式地经过受众审查,因为在某个时候,他们的读者会使用这些文档,并希望在它们不起作用时(通过bug或其他形式的反馈)让你知道。) To change the quality of engineering documentation, engineers—and the entire engineering organization—need to accept that they are both the problem and the solution. Rather than throw up their hands at the state of documentation, they need to realize that producing quality documentation is part of their job and saves them time and effort in the long run. For any piece of code that you expect to live more than a few months, the extra cycles you put in documenting that code will not only help others, it will help you maintain that code as well.(为了改变工程文档的质量,工程师和整个工程组织需要接受他们既是问题又是解决方案。他们需要意识到,制作高质量的文档是他们工作的一部分,从长远来看,这可以节省他们的时间和精力,而不是在当前文档状态下束手无策。对于任何一段生命周期超过几个月的代码,记录该代码的额外周期不仅有助于其他人,也有助于维护该代码。)

《Software Engineering at Google》摘抄(9)

by kevin 27. 九月 2022 13:56 >
Google’s culture, like that of a lot of software companies, is based on giving engineers wide latitude in how they do their jobs. There is a recognition that strict processes tend not to work well for a dynamic company needing to respond quickly to new technologies, and that bureaucratic rules tend not to work well with creative professionals. Code review, however, is a mandate, one of the few blanket processes in which all software engineers at Google must participate. Google requires code review for almost[^4] every code change to the codebase, no matter how small. This mandate does have a cost and effect on engineering velocity given that it does slow down the introduction of new code into a codebase and can impact time-to-production for any given code change. (Both of these are common complaints by software engineers of strict code review processes.) Why, then, do we require this process? Why do we believe that this is a long-term benefit?(谷歌的文化,就像许多软件公司的文化一样,是基于给工程师们在工作中的自由度。人们认识到,对于需要对新技术做出快速反应的充满活力的公司来说,严格的流程往往不起作用,而官僚主义的规则往往不适合创造性专业人士。然而,代码审查是一项任务,是谷歌所有软件工程师都必须参与的少数全流程之一。谷歌要求对代码库的每一次代码修改都要进行代码审查,无论多么微小。这个任务确实对工程速度有成本和影响,因为它确实减缓了将新代码引入代码库的速度,并可能影响任何特定代码更改的生产时间。(这两点是软件工程师对严格的代码审查过程的常见抱怨)。那么,为什么我们要要求这个过程?为什么我们相信这是一个长期有利的?) 一个精心设计的代码审查过程和认真对待代码审查的文化会带来以下好处: 检查代码的正确性 确保其他工程师能够理解代码更改 强化整个代码库的一致性 从心理上促进团队的所有权 实现知识共享 提供代码审查本身的历史记录 Surprisingly enough, checking for code correctness is not the primary benefit Google accrues from the process of code review. Checking for code correctness generally ensures that a change works, but more importance is attached to ensuring that a code change is understandable and makes sense over time and as the codebase itself scales. To evaluate those aspects, we need to look at factors other than whether the code is simply logically “correct” or understood.(令人惊讶的是,检查代码的正确性并不是谷歌从代码审查过程中获得的最大好处。检查代码正确性通常可以确保更改有效,但更重要的是确保代码更改是可以理解的,并且随着时间的推移和代码库本身的扩展而变得有意义。为了评估这些方面,我们需要查看除代码在逻辑上是否“正确”或理解之外的其他因素。) Code review also has important cultural benefits: it reinforces to software engineers that code is not “theirs” but in fact part of a collective enterprise. Such psychological benefits can be subtle but are still important. Without code review, most engineers would naturally gravitate toward personal style and their own approach to software design. The code review process forces an author to not only let others have input, but to compromise for the sake of the greater good.(代码审查还有重要的文化好处:它向软件工程师强调代码不是“他们的”,而是事实上集体事业的一部分。这种心理上的好处可能很微妙,但仍然很重要。没有代码审查,大多数工程师自然会倾向于个人风格和他们自己的软件设计方法。代码审查过程迫使作者不仅要让别人提出意见,而且要为了更大的利益做出妥协。) Part of the code review process of feedback and confirmation involves asking questions on why the change is done in a particular way. This exchange of information facilitates knowledge sharing. In fact, many code reviews involve an exchange of information both ways: the authors as well as the reviewers can learn new techniques and patterns from code review. At Google, reviewers may even directly share suggested edits with an author within the code review tool itself.(反馈和确认的代码评审过程的一部分包括询问为什么以特定方式进行更改。这种信息交流有助于知识共享。事实上,许多代码评审都涉及双向信息交换:作者和审查员都可以从代码评审中学习新的技术和模式。在谷歌,审查员甚至可以直接在代码审查工具中与作者分享建议的编辑。) In general, reviewers should defer to authors on particular approaches and only point out alternatives if the author’s approach is deficient. If an author can demonstrate that several approaches are equally valid, the reviewer should accept the preference of the author. Even in those cases, if defects are found in an approach, consider the review a learning opportunity (for both sides!). All comments should remain strictly professional. Reviewers should be careful about jumping to conclusions based on a code author’s particular approach. It’s better to ask questions on why something was done the way it was before assuming that approach is wrong.(一般来说,审查员应该在特定的方法上听从作者的意见,只有在作者的方法有缺陷时才指出替代方法。如果作者能证明几种方法同样有效,审查员应该接受作者的偏好。即使在这些情况下,如果发现一个方法有缺陷,也要把审查看作是一个学习的机会(对双方都是如此!)。所有的评论都应该严格保持专业性。审查员应该注意不要根据代码作者的特定方法就下结论。在假设该方法是错误的之前,最好先问一下为什么要这样做。) As much as we expect professionalism on the part of the reviewer, we expect professionalism on the part of the author as well. Remember that you are not your code, and that this change you propose is not “yours” but the team’s. After you check that piece of code into the codebase, it is no longer yours in any case. Be receptive to questions on your approach, and be prepared to explain why you did things in certain ways. Remember that part of the responsibility of an author is to make sure this code is understandable and maintainable for the future.(就像我们期望审查员有专业精神一样,我们也期望作者有专业精神。记住,你不是你的代码,你提出的这个修改不是 "你的",而是团队的。在你把这段代码检查到代码库中后,它无论如何都不再是你的了。要乐于接受关于你的方法的问题,并准备好解释你为什么以某种方式做事情。记住,作者的部分责任是确保这段代码是可以理解的,并且可以为将来维护。) It’s important to treat each reviewer comment within a code review as a TODO item; a particular comment might not need to be accepted without question, but it should at least be addressed. If you disagree with a reviewer’s comment, let them know, and let them know why and don’t mark a comment as resolved until each side has had a chance to offer alternatives. One common way to keep such debates civil if an author doesn’t agree with a reviewer is to offer an alternative and ask the reviewer to PTAL (please take another look). Remember that code review is a learning opportunity for both the reviewer and the author. That insight often helps to mitigate any chances for disagreement.(重要的是要把代码审查中的每个审查者的评论当作一个TODO项目;一个特定的评论可能不需要被无条件接受,但它至少应该被解决。如果你不同意一个评审员的评论,让他们知道,并让他们知道为什么,在双方都有机会提供替代方案之前,不要把评论标记为已解决。如果作者不同意审查员的意见,保持这种辩论的一个常见方法是提供一个替代方案,并要求评审员PTAL(请再看看)。记住,代码审查对于审查者和作者来说都是一个学习的机会。这种洞察力往往有助于减少任何分歧的场景。)

《Software Engineering at Google》摘抄(8)

by kevin 21. 九月 2022 13:55 >
Rules are laws. They are not just suggestions or recommendations, but strict, mandatory laws. As such, they are universally enforceable—rules may not be disregarded except as approved on a need-to-use basis. In contrast to rules, guidance provides recommendations and best practices. These bits are good to follow, even highly advisable to follow, but unlike rules, they usually have some room for variance.(规则就像法律。 它们不仅仅是建议或提议,而是严格的、强制性的法律。 因此,规则具有普遍可执行性——不得无视规则除非在需要使用的基础上获得豁免。 与规则相反,指导提供帮助建议和最佳实践。 指导值得遵循,甚至是高度建议能够遵守,但与规则不同的是,指导通常允许出现一些变化的空间。) When defining a set of rules, the key question is not, “What rules should we have?” The question to ask is, “What goal are we trying to advance?” When we focus on the goal that the rules will be serving, identifying which rules support this goal makes it easier to distill the set of useful rules. At Google, where the style guide serves as law for coding practices, we do not ask, “What goes into the style guide?” but rather, “Why does something go into the style guide?” What does our organization gain by having a set of rules to regulate writing code?(当定义一组规则时,关键问题不是“我们应该有什么规则?”我们要问的问题是:“我们想要实现的目标是什么?”当我们关注规则将服务的目标时,识别哪些规则支持这个目标,可以更容易地提取有用的规则集。在谷歌,风格指南作为编码实践的法规,我们不会问,“风格指南中包含什么?”而是“为什么要把一些东西放进风格指南?”我们的组织通过制定一套规范代码编写的规则获得了什么?) Setting the standard. When we advocate for consistency, we tend to focus on internal consistency. Sometimes, local conventions spring up before global ones are adopted, and it isn’t reasonable to adjust everything to match. In that case, we advocate a hierarchy of consistency: “Be consistent” starts locally, where the norms within a given file precede those of a given team, which precede those of the larger project, which precede those of the overall codebase. In fact, the style guides contain a number of rules that explicitly defer to local conventions[^6], valuing this local consistency over a scientific technical choice.(设置标准。 当我们提倡一致性时,我们倾向于关注内部一致性。有时,局部的惯例规则在整体惯例规则产生之前就已经出现了,因此调整一切来适应整体惯例规则是不合理的。在这种情况下,我们提倡一种层级的一致性:“保持一致性”从局部开始,一个文件中的规范优先于一个团队的规范,优先于更大的项目的规范,也优先于整个代码库的规范。事实上,风格指南包含了许多明确遵守局部惯例的规则,重视局部的一致性,而不是科学技术的选择。) If conventions already exist, it is usually a good idea for an organization to be consistent with the outside world. For small, self-contained, and short-lived efforts, it likely won’t make a difference; internal consistency matters more than anything happening outside the project’s limited scope. Once the passage of time and potential scaling become factors, the likelihood of your code interacting with outside projects or even ending up in the outside world increase. Looking long-term, adhering to the widely accepted standard will likely pay off.(如果惯例已经存在,那么一个组织与外界保持一致通常是一个好主意。对于小的,独立的,生命周期短的项目,它可能不会有什么不同;内部一致性比发生在项目有限范围之外的任何事情都重要。一旦时间的推移和潜在的扩展性成为要素,代码与外部项目交互甚至最终与外部世界交互的可能性就会增加。从长远来看,坚持被广泛接受的标准可能会有回报。) Our style guides also include limitations on new and not-yet-well-understood language features. The goal is to preemptively install safety fences around a feature’s potential pitfalls while we all go through the learning process. At the same time, before everyone takes off running, limiting use gives us a chance to watch the usage patterns that develop and extract best practices from the examples we observe. For these new features, at the outset, we are sometimes not sure of the proper guidance to give. As adoption spreads, engineers wanting to use the new features in different ways discuss their examples with the style guide owners, asking for allowances to permit additional use cases beyond those covered by the initial restrictions. Watching the waiver requests that come in, we get a sense of how the feature is getting used and eventually collect enough examples to generalize good practice from bad. After we have that information, we can circle back to the restrictive ruling and amend it to allow wider use.(我们的风格指南还包括对新的和尚未被很好理解的语言特性的限制。目的是在学习过程中,在一个功能的潜在缺陷周围预先安装安全围栏。同时,在每个人都应用起来之前,限制使用让我们有机会观察,从我们观察的例子中开发和提取最佳实践的使用模式。对于这些新特性,在开始的时候,我们有时并不确定该如何给予适当的指导。随着采用范围的扩大,希望以不同方式使用新特性的工程师会与风格指南的所有者讨论他们的例子,要求允许超出最初限制范围的额外用例。通过观察收到的豁免请求,我们了解了该特性是如何被使用的,并最终收集了足够多的示例来总结好的实践。在我们得到这些信息之后,我们可以回到限制性规则,并修改它以允许更广泛的使用。) The decisions behind rules captured in our style guides are backed by evidence. When adding a rule, we spend time discussing and analyzing the relevant pros and cons as well as the potential consequences, trying to verify that a given change is appropriate for the scale at which Google operates. Most entries in Google’s style guides include these considerations, laying out the pros and cons that were weighed during the process and giving the reasoning for the final ruling. Ideally, we prioritize this detailed reasoning and include it with every rule.(在我们的风格指南中,规则背后的决定是有证据支持的。在添加规则时,我们将花时间讨论和分析相关的利弊以及潜在的后果,并试图验证给定的更改是否适合谷歌运营规模。谷歌风格指南中的大多数条目都包含了这些考虑因素,列出了在过程中权衡的利弊,并给出了最终裁决的理由。理想情况下,我们优先考虑这种详细的推理,并将其包含在每条规则中。) The actual decision making for any style guide change is a discussion of the engineering trade-offs for the proposed modification. The arbiters make decisions within the context of the agreed-upon goals for which the style guide optimizes. Changes are not made according to personal preference; they’re trade-off judgments. In fact, the C++ style arbiter group currently consists of four members. This might seem strange: having an odd number of committee members would prevent tied votes in case of a split decision. However, because of the nature of the decision making approach, where nothing is “because I think it should be this way” and everything is an evaluation of trade-off, decisions are made by consensus rather than by voting. The four-member group is happily functional as-is.(对于任何风格指南的更改,实际的决策都是对提议修改的工程权衡的反复讨论。仲裁者在风格指南优化的一致目标上下文中做出决定。更改并非根据个人喜好。它们是权衡判断。事实上,C++风格仲裁组目前由四个成员组成。这可能看起来很奇怪:如果委员会成员人数为奇数,就可以防止出现出现意见分歧的情况,出现票数平手的情况。然而,由于决策制定方法的本质,没有什么是“因为我认为它应该是这样的”,一切都是一种权衡,决策是通过共识而不是投票做出的。这个由四名成员组成的小组就这样愉快地运作着。) Guidance represents the collected wisdom of our engineering experience, documenting the best practices that we’ve extracted from the lessons learned along the way. Guidance tends to focus on things that we’ve observed people frequently getting wrong or new things that are unfamiliar and therefore subject to confusion. If the rules are the “musts,” our guidance is the “shoulds.”(指导代表了我们收集的工程经验的智慧,记录了我们从一路走来的经验教训中提取的最佳实践。指导往往侧重于我们观察到人们经常出错的事情或不熟悉并因此容易混淆的新事物。如果规则是“必须”,那么我们的指导就是“应该”。)

《Software Engineering at Google》摘抄(7)

by kevin 8. 九月 2022 14:07 >
At Google, we use the Goals/Signals/Metrics (GSM) framework to guide metrics creation. 在谷歌,我们使用目标/信号/指标(GSM)框架来指导指标创建。 A goal is a desired end result. It’s phrased in terms of what you want to understand at a high level and should not contain references to specific ways to measure it. A signal is how you might know that you’ve achieved the end result. Signals are things we would like to measure, but they might not be measurable themselves. A metric is proxy for a signal. It is the thing we actually can measure. It might not be the ideal measurement, but it is something that we believe is close enough. 目标是一个期望的最终结果。它是根据你希望在高层次上理解的内容来表述的,不应包含对具体测量方法的引用。。 信号是你如何知道你已经实现了最终结果。信号是我们想要衡量的东西,但它们本身可能是不可测量的。 指标是信号的代表。它是我们实际上可以测量的东西。它可能不是理想的测量,但它是我们认为足够接近的东西。   The GSM framework encourages several desirable properties when creating metrics. First, by creating goals first, then signals, and finally metrics, it prevents the streetlight effect. The term comes from the full phrase “looking for your keys under the streetlight”: if you look only where you can see, you might not be looking in the right place. With metrics, this occurs when we use the metrics that we have easily accessible and that are easy to measure, regardless of whether those metrics suit our needs. Instead, GSM forces us to think about which metrics will actually help us achieve our goals, rather than simply what we have readily available. GSM框架在创建指标时鼓励几个理想的属性。首先,通过首先创建目标,然后是信号,最后是指标,它可以防止路灯效应。这个词来自于 "在路灯下找你的钥匙 "这个完整的短语:如果你只看你能看到的地方,你可能没有找对地方。对于指标来说,当我们使用我们容易获得的、容易测量的指标时,就会出现这种情况,不管这些指标是否适合我们的需求。相反,GSM迫使我们思考哪些指标能真正帮助我们实现目标,而不是简单地考虑我们有哪些现成的指标。 Second, GSM helps prevent both metrics creep and metrics bias by encouraging us to come up with the appropriate set of metrics, using a principled approach, in advance of actually measuring the result. Consider the case in which we select metrics without a principled approach and then the results do not meet our stakeholders’ expectations. At that point, we run the risk that stakeholders will propose that we use different metrics that they believe will produce the desired result. And because we didn’t select based on a principled approach at the start, there’s no reason to say that they’re wrong! Instead, GSM encourages us to select metrics based on their ability to measure the original goals. Stakeholders can easily see that these metrics map to their original goals and agree, in advance, that this is the best set of metrics for measuring the outcomes. 第二,GSM通过鼓励我们使用原则性的方法提出适当的指标集,从而有助于防止指标蠕变和指标偏差,从而有助于实际测量结果。考虑这样一种情况,我们在没有原则性方法的情况下选择指标,然后结果不符合我们的利益相关者的期望。在这一点上,我们面临着利益相关者建议我们使用他们认为会产生预期结果的不同指标的风险。而且因为我们一开始并没有基于原则性的方法进行选择,所以没有理由说他们错了!相反,GSM鼓励我们根据衡量原始目标的能力选择指标。利益相关者可以很容易地看到这些指标映射到他们的 最初的目标,并提前同意这是衡量结果的最佳指标集。 虽然这显然是一个极端的例子,但团队在测量时总是忘记了核心的权衡:他们太专注于提高速度而忘记了测量质量(或者反过来)。为了解决这个问题,我们的研究团队将生产效率分为五个核心部分。这五个部分是相互权衡的,我们鼓励团队考虑每一个部分的目标,以确保他们不会在无意中提高一个部分而使其他部分下降。为了帮助人们记住所有五个组成部分,我们使用了 "QUANTS "的记忆法: 代码的**质量** 产生的代码的质量如何?测试用例是否足以预防回归?架构在减轻风险和变化方面的能力如何? 工程师的**关注度** 工程师达到流动状态的频率如何?他们在多大程度上被通知分散了注意力?工具是否鼓励工程师进行状态切换? 知识的复杂性 完成一项任务需要多大的认知负荷?正在解决的问题的内在复杂性是什么?工程师是否需要处理不必要的复杂性? 节奏和速度 工程师能多快地完成他们的任务?他们能以多快的速度把他们的版本推出去?他们在给定的时间范围内能完成多少任务? 满意程度 工程师对他们的工具有多满意?工具能在多大程度上满足工程师的需求?他们对自己的工作和最终产品的满意度如何?工程师是否感到筋疲力尽? 回到可读性的例子,我们的研究团队与可读性团队合作,确定了可读性过程中的几个生产力目标。 代码的质量 由于可读性过程,工程师们写出了更高质量的代码;由于可读性过程,他们写出了更一致的代码;由于可读性过程,他们为代码的健康文化做出了贡献。 来自工程师的关注 我们没有为可读性制定任何关注目标。这是可以的! 并非所有关于工程生产力的问题都涉及所有五个领域的权衡。 知识复杂性 工程师们通过可读性过程了解谷歌代码库和最佳编码实践,他们在可读性过程中接受指导。 节奏和速度 由于可读性过程,工程师更快、更有效地完成工作任务。 满意度 工程师们看到了可读性过程的好处,对参与该过程有积极的感受。   Recall our original goal in this chapter: we want to take action and improve productivity. After performing research on a topic, the team at Google always prepares a list of recommendations for how we can continue to improve. We might suggest new features to a tool, improving latency of a tool, improving documentation, removing obsolete processes, or even changing the incentive structures for the engineers. Ideally, these recommendations are “tool driven”: it does no good to tell engineers to change their process or way of thinking if the tools do not support them in doing so. We instead always assume that engineers will make the appropriate trade-offs if they have the proper data available and the suitable tools at their disposal. 回顾我们在本章中的最初目标:我们希望采取行动,提高生产效率。在对某个主题进行研究之后,谷歌的团队总是准备一份建议清单,说明我们可以如何继续改进。我们可能会建议给一个工具增加新的功能,改善工具的延迟,改善文档,删除过时的流程,甚至改变工程师的激励结构。理想情况下,这些建议是 "工具驱动 "的:如果工具不支持工程师改变他们的流程或思维方式,那么告诉他们这样做是没有用的。相反,我们总是假设,如果工程师有适当的数据和合适的工具可以使用,他们会做出适当的权衡。

《Software Engineering at Google》摘抄(6)

by kevin 6. 九月 2022 13:50 >
As your role evolves, all the best practices still apply. You’re still a “servant leader”; you’re just serving a larger group. That said, the scope of problems you’re solving becomes larger and more abstract. You’re gradually forced to become “higher level.” That is, you’re less and less able to get into the technical or engineering details of things, and you’re being pushed to go “broad” rather than “deep.” At every step, this process is frustrating: you mourn the loss of these details, and you come to realize that your prior engineering expertise is becoming less and less relevant to your job. Instead, your effectiveness depends more than ever on your general technical intuition and ability to galvanize engineers to move in good directions.(随着你角色的变化,之前的最佳实践仍适用。你仍然是一个服务型领导;你只不过是开始服务于更大的团队了。这就是说,需要你解决的问题领域更大,更抽象了。你被迫上升到了"更高层次"。你越来越不太能接触到具体的技术上的或工程上的细节,被迫地,你需要知道的更“广泛”,而不是更“深入”。这个过程的每一步都令人沮丧:你丧失了对技术细节的掌控,然后渐渐意识到之前的工程经验与你现在的工作的关联性越来越少。你的工作效率变得更加依赖对通用的技术领域的直觉和引导工程师找对正确的前进方向上。) So, assuming that we understand the basics of leadership, what it does it take to scale yourself into a really good leader? That’s what we talk about here, using what we call “the three Always of leadership”: Always Be Deciding, Always Be Leaving, Always Be Scaling.(至此,假设我们已经知道了领导的本质,那么到底什么才能让你提升为一个真正优秀的管理者呢?这就是我们这里想要讨论的,我们称之为“管理上的三个总是”:始终保持决断力,始终保持离开,始终保持扩张。) Coming back to Bharat’s quote: being a successful leader means building an organization that is able to solve the difficult problem by itself. That organization needs to have a strong set of leaders, healthy engineering processes, and a positive, self-perpetuating culture that persists over time. Yes, this is difficult; but it gets back to the fact that leading a team of teams is often more about organizing people rather than being a technical wizard. Again, there are three main parts to constructing this sort of self-sufficient group: dividing the problem space, delegating subproblems, and iterating as needed.(让我们回到引用的 Bharat 的话:做一个成功的管理者意味着构建一个能够独自解决问题的组织。这个组织需要有一套强有力的领导,健康的工程流程,一个积极的,能够自我延续,经时间沉淀的文化。是的,这很难;但是这回归到了事情的本质,领导团队的通常更多地意味着管理人,而不是作为一个技术向导。再强调一次,这种自给自足的团队有三个主要的组成部分:划分问题域,委托子任务,以及对于不足的地方反复迭代。) That said, if you agree that your mission is to build a self-driving organization, the main mechanism of teaching is through delegation. You must build a set of self-sufficient leaders, and delegation is absolutely the most effective way to train them. You give them an assignment, let them fail, and then try again and try again. Silicon Valley has well-known mantras about “failing fast and iterating.” That philosophy doesn’t just apply to engineering design, but to human learning as well.(也就是说,如果你的使命是构建一个自我驱动型的组织,那主要的方法就是通过授权。你必须培养出一系列的能够自我成长、自给自足的领导,允许他们失败,然后一遍又一遍的尝试。硅谷有一个有名的咒语“快速失败,然后反复迭代。”这个理论不仅适用于工程设计方面,同样也适用于人类学习。) The corollary here is that you need to be mindful of your own purpose as a leader of leaders. If you find yourself deep in the weeds, you’re doing a disservice to your organization. When you get to work each day, ask yourself a different critical question: What can I do that nobody else on my team can do?(这里的推论是,在做领导的领导这件事上,你可能需要格外留心。如果你发现你陷在细节里陷得太深,你可能正在破坏你的团队。每天工作时,你要问自己另外一个重要的问题:有什么事情是除了我以为团队里的其他人做不了的?) A common mistake is to put a team in charge of a specific product rather than a general problem. A product is a solution to a problem. The life expectancy of solutions can be short, and products can be replaced by better solutions. However, a problem — if chosen well—can be evergreen. Anchoring a team identity to a specific solution (“We are the team that manages the Git repositories”) can lead to all sorts of angst over time. What if a large percentage of your engineers want to switch to a new version control system? The team is likely to “dig in,” defend its solution, and resist change, even if this is not the best path for the organization. The team clings to its blinders, because the solution has become part of the team’s identity and self-worth. If the team instead owns the problem (e.g., “We are the team that provides version control to the company”), it is freed up to experiment with different solutions over time.(一个常见的错误是让一个团队负责一个特定的产品而不是负责解决一类问题。一个产品是一个问题的一种解决方案。一个解决方案的生命周期可能很短,一个产品可能会被更好的方案替代。然而,一个问题(如果这个问题的定位比较合理)却可以是经久不衰的。将一个团队定位为一个特定的解决方案(“我们是负责 Git 仓库的团队”)随着时间的推移将会带来各种各样的麻烦。假如很大一部分工程师想切换到一个新的版本控制系统怎么办?这个团队很可能会“钻牛角尖”,坚持它原有的解决方案,拒绝改变,及时它并不是最适合整个组织的方案。这个团队依赖它的“观点”,因为解决方案已经成为团队身份和自我价值的一部分。如果团队改为是负责解决这个问题(比方说“我们是为这个公司提供版本管理的团队”),那么随着时间的推移,这个团队将不再被束缚去做实验尝试不同的解决方案。) Instead, we’re going to discuss team scaling from a defensive and personal point of view rather than an offensive one. As a leader, your most precious resource is your limited pool of time, attention, and energy. If you aggressively build out your teams’ responsibilities and power without learning to protect your personal sanity in the process, the scaling is doomed to fail. And so we’re going to talk about how to effectively scale yourself through this process.(相反,我们将讨论从保守和从个人观点出发而不是进攻的视角来讨论扩张团队。作为领导者,你最宝贵的资源是你有限的时间、精力和能量。如果你在没有学会保护维持自己的精力正常的情况下,就激进地增加团队的职责和权力,你的扩张将注定失败。于是我们接下来将讨论如何在扩张的过程中有效地提升自己。) So really, the cycle of success is more of a spiral (see Figure 6-2). Over months and years, your organization is scaling by tackling new problems and then figuring out how to compress them so that it can take on new, parallel struggles. If you’re lucky, you’re allowed to hire more people as you go. More often than not, though, your hiring doesn’t keep pace with the scaling. Larry Page, one of Google’s founders, would probably refer to this spiral as “uncomfortably exciting.”(所以,成功的循环更像是一个螺旋(参见图 6-2)。长年累月以来,你的组织通过解决新问题来扩张,然后压缩所需的人力来能够接受新的、并行的问题。如果你足够幸运,你才能被允许招聘更多的人。然而更常见的情况是你招聘的速度赶不上你团队规模扩张的速度。Larry Page,Google 的创始人之一,喜欢把这个螺旋比作“令人不适的刺激”。) The spiral of success is a conundrum—it’s something that’s difficult to manage, and yet it’s the main paradigm for scaling a team of teams. The act of compressing a problem isn’t just about figuring out how to maximize your team’s efficiency, but also about learning to scale your own time and attention to match the new breadth of responsibility.(成功的螺旋确实是个难题--这是难以管理的,而且这是扩充团队的团队的核心范式。压缩问题的行为不只是关于找出使团队效率最大化的方法,而且是关于如何扩充你自己的时间和注意力来应对新的责任。) It might feel terrible to do so at first, but as you deliberately drop so many balls, you’ll discover two amazing things. First, even if you don’t delegate that middle 60% of tasks, your subleaders often notice and pick them up automatically. Second, if something in that middle bucket is truly critical, it ends up coming back to you anyway, eventually migrating up into the top 20%. You simply need to trust that things below your top-20% threshold will either be taken care of or evolve appropriately. Meanwhile, because you’re focusing only on the critically important things, you’re able to scale your time and attention to cover your group’s ever-growing responsibilities.(最开始,这么做可能会感觉很可怕,但随着你故意丢掉这么多球,你将会发现两件令人惊奇的事。第一,即使你没有托管中间60%的事,你的下属领导者们通常会意识到并主动接住它们。第二,如果中间这堆球中有真正重要的事,它最终无论如何都会回到你这里,然后转换到顶部20%那堆球里。你只需相信在20%阈值下的事情最终都会被有人接管,或是在适当时候知会给适当的人。与此同时,因为你只关注最重要的事情,你可以花更多时间和注意力在承担你的团队不断增长的责任上。)

《Software Engineering at Google》摘抄(5)

by kevin 2. 九月 2022 14:24 >
In nascent teams, both roles will sometimes be filled by the same person: a Tech Lead Manager (TLM). On larger teams, an experienced people manager will step in to take on the management role while a senior engineer with extensive experience will step into the tech lead role. Even though manager and tech lead each play an important part in the growth and productivity of an engineering team, the people skills required to succeed in each role are wildly different.(在新生团队中,这两个角色有时会由同一个人担任:技术主管经理(TLM)。在较大的团队中,有经验的人事经理将介入管理角色,而具有丰富经验的高级工程师将进入技术负责人的角色。尽管经理和技术负责人在工程团队的成长和生产效率方面都发挥着重要作用,但在每个角色中取得成功所需的人际关系技能却大不相同。) Many companies bring in trained people managers who might know little to nothing about software engineering to run their engineering teams. Google decided early on, however, that its software engineering managers should have an engineering background. This meant hiring experienced managers who used to be software engineers, or training software engineers to be managers (more on this later).(许多公司引进了训练有素的人事经理,他们可能对软件工程知之甚少,甚至一无所知来管理工程团队。然而,谷歌很早就决定,其软件工程经理应该有工程背景。这意味着雇用曾经是软件工程师的有经验的经理,或者培训软件工程师成为经理(后面会有更多介绍)。) The tech lead (TL) of a team—who will often report to the manager of that team—is responsible for (surprise!) the technical aspects of the product, including technology decisions and choices, architecture, priorities, velocity, and general project management (although on larger teams they might have program managers helping out with this). The TL will usually work hand in hand with the engineering manager to ensure that the team is adequately staffed for their product and that engineers are set to work on tasks that best match their skill sets and skill levels. Most TLs are also individual contributors, which often forces them to choose between doing something quickly themselves or delegating it to a team member to do (sometimes) more slowly. The latter is most often the correct decision for the TL as they grow the size and capability of their team.(团队的技术负责人(TL)通常会向该团队的经理汇报,负责产品的技术方面,包括技术决策和选择、架构、优先级、速度和总体项目管理(尽管在较大的团队中,他们可能会有项目经理帮助处理这个问题)。TL通常会与工程经理携手合作,以确保团队有足够的人员来完成他们的产品,并确保工程师被安排在最符合他们技能组合和技能水平的任务上工作。大多数TL也是个人贡献者,这往往迫使他们在自己快速做某事或委托团队成员做(有时)更慢的事之间做出选择。对于TL来说,随着团队规模和能力的增长,后者通常是正确的决策。) Another difference that takes getting used to is that the things we do as managers typically pay off over a longer timeline.( 另一个需要适应的差异是,我们作为管理者所做的事情通常会在更长的时间后才得到回报。) There seems to be a sort of disease that strikes managers in which they forget about all the awful things their managers did to them and suddenly begin doing these same things to “manage” the people that report to them. The symptoms of this disease include, but are by no means limited to, micromanaging, ignoring low performers, and hiring pushovers. Without prompt treatment, this disease can kill an entire team. The best advice I received when I first became a manager at Google was from Steve Vinter, an engineering director at the time. He said, “Above all, resist the urge to manage.” One of the greatest urges of the newly minted manager is to actively “manage” their employees because that’s what a manager does, right? This typically has disastrous consequences.(似乎有一种疾病袭扰了经理们,他们忘记了他们的经理对他们所做的所有可怕的事情,突然开始做同样的事情来 "管理 "向他们汇报的人。这种疾病的症状包括,但不限于,微观管理(事必躬亲),忽视低绩效员工,以及使用推卸责任者。如果不及时治疗,这种疾病可以杀死整个团队。当我第一次在谷歌成为经理时,我得到的最好的建议是来自当时的工程总监史蒂夫·温特。他说:"首先,要抵制管人的冲动"。新上任的经理人最大的冲动之一就是积极 "管理 "他们的员工,因为这就是经理的工作,对吗?这通常会带来灾难性的后果。) The cure for the “management” disease is a liberal application of “servant leadership,” which is a nice way of saying the most important thing you can do as a leader is to serve your team, much like a butler or majordomo tends to the health and well-being of a household. As a servant leader, you should strive to create an atmosphere of humility, respect, and trust. This might mean removing bureaucratic obstacles that a team member can’t remove by themselves, helping a team achieve consensus, or even buying dinner for the team when they’re working late at the office. The servant leader fills in the cracks to smooth the way for their team and advises them when necessary, but still isn’t afraid of getting their hands dirty. The only managing that a servant leader does is to manage both the technical and social health of the team; as tempting as it might be to focus on purely the technical health of the team, the social health of the team is just as important (but often infinitely more difficult to manage).(“管理”疾病的治疗方法是“服务型领导”的自由运用这是一个很好的做法,作为一个领导者,你能做的最重要的事情就是为你的团队服务,就像一个管家或大管家关心一个家庭的健康和福祉一样。作为一个服务型领导者,你应该努力营造一种谦逊、尊重和信任的氛围。这可能意味着消除团队成员自己无法消除的官僚主义障碍,帮助团队达成共识,甚至在团队在办公室工作到很晚的时候为他们买晚餐。服务型领导会填补缝隙,为他们的团队铺平道路,必要时为他们提供建议,但仍然不怕弄脏自己的手。服务型领导所做的唯一管理就是管理团队的技术和社会健康;尽管单纯关注团队的技术健康可能很诱人,但团队的氛围健康也同样重要(但往往更难管理)。) Most people still use the title “manager” despite the fact that it’s often an anachronism. The title itself often encourages new managers to manage their reports. Managers can wind up acting like parents,[^4] and consequently employees react like children. To frame this in the context of humility, respect, and trust: if a manager makes it obvious that they trust their employee, the employee feels positive pressure to live up to that trust. It’s that simple. A good manager forges the way for a team, looking out for their safety and well-being, all while making sure their needs are met. If there’s one thing you remember from this chapter, make it this: Traditional managers worry about how to get things done, whereas great managers worry about what things get done (and trust their team to figure out how to do it).(大多数人仍然使用 "经理 "这个头衔,尽管它往往是一个不合时宜的头衔。这个头衔本身经常鼓励新经理撰写报告。经理们可能会表现得像父母一样,因此员工的反应也像孩子。从谦逊、尊重和信任的角度来看:如果经理明显地表示他们信任员工,那么员工就会感到有积极的压力,不辜负这种信任。就是这么简单。好的经理为团队开辟道路,关注他们的安全和福祉,同时确保他们的需求得到满足。如果你在本章中记住了一件事,那就是这个: 传统的经理担心的是如何把事情做好,而优秀的经理担心的是把什么事情做好(并相信他们的团队能想出办法来)。) Instead, you should strive to hire people who are smarter than you and can replace you. This can be difficult because these very same people will challenge you on a regular basis (in addition to letting you know when you make a mistake). These very same people will also consistently impress you and make great things happen. They’ll be able to direct themselves to a much greater extent, and some will be eager to lead the team, as well. You shouldn’t see this as an attempt to usurp your power; instead, look at it as an opportunity for you to lead an additional team, investigate new opportunities, or even take a vacation without worrying about checking in on the team every day to make sure it’s getting its work done. It’s also a great chance to learn and grow—it’s a lot easier to expand your expertise when surrounded by people who are smarter than you.(相反,你应该努力雇用比你更聪明的人,并能取代你。这可能很困难,因为这些人也会定期挑战你(除了在你犯错时只有你自己知道)。这些人也会不断地给你留下深刻印象,并让伟大的事情出现。他们将能够在更大程度上指导自己,有些人也会渴望领导团队。你不应该把这看作是企图篡夺你的权力;相反,你应该把它看作是一个机会,让你领导一个额外的团队,找到新的机会,甚至休假,而不必担心每天都要检查团队,确保它完成工作。这也是一个学习和成长的好机会——当周围有比你更聪明的人时,拓展你的专业知识会容易得多。) Ignoring low performers is not only a way to keep new high performers from joining your team, but it’s also a way to encourage existing high performers to leave. You eventually wind up with an entire team of low performers because they’re the only ones who can’t leave of their own volition. Lastly, you aren’t even doing the low performer any favors by keeping them on the team; often, someone who wouldn’t do well on your team could actually have plenty of impact somewhere else.(忽视低绩效员工不仅会阻碍新的高绩效员工加入你的团队,而且也会鼓励现有的高绩效员工离开。你最终会发现整个团队都是低绩效员工,因为他们是唯一不能主动离开的人。最后,你把低绩效员工留在团队中,甚至对他们没有任何好处;通常情况下,一个在你的团队中做得不好的人,实际上可以在其他地方产生很大的影响。) It might feel terrible to do so at first, but as you deliberately drop so many balls, you’ll discover two amazing things. First, even if you don’t delegate that middle 60% of tasks, your subleaders often notice and pick them up automatically. Second, if something in that middle bucket is truly critical, it ends up coming back to you anyway, eventually migrating up into the top 20%. You simply need to trust that things below your top-20% threshold will either be taken care of or evolve appropriately. Meanwhile, because you’re focusing only on the critically important things, you’re able to scale your time and attention to cover your group’s ever-growing responsibilities.(最开始,这么做可能会感觉很可怕,但随着你故意丢掉这么多球,你将会发现两件令人惊奇的事。第一,即使你没有托管中间60%的事,你的下属领导者们通常会意识到并主动接住它们。第二,如果中间这堆球中有真正重要的事,它最终无论如何都会回到你这里,然后转换到顶部20%那堆球里。你只需相信在20%阈值下的事情最终都会被有人接管,或是在适当时候知会给适当的人。与此同时,因为你只关注最重要的事情,你可以花更多时间和注意力在承担你的团队不断增长的责任上。) Remember that you can lead a team and build consensus without being a close friend of your team (or a monumental hard-ass). Likewise, you can be a tough leader without tossing your existing friendships to the wind. We’ve found that having lunch with your team can be an effective way to stay socially connected to them without making them uncomfortable—this gives you a chance to have informal conversations outside the normal work environment.(请记住,你可以领导一个团队并建立共识,而不需要成为你团队的亲密朋友(或一个不折不扣的硬汉)。同样,你也可以成为一个强硬的领导者,而不把你现有的友谊扔到九霄云外。我们发现,与你的团队共进午餐是一种有效的方式,既能与他们保持社交联系,又不会让他们感到不舒服——这让你有机会在正常工作环境之外进行非正式的对话。) Part of “losing the ego” is trust: you need to trust your team. That means respecting the abilities and prior accomplishments of the team members, even if they’re new to your team.(“丢失自负 "的一部分是信任:你需要信任你的团队。这意味着尊重团队成员的能力和先前的成就,即使他们是团队的新成员。) If you’re not micromanaging your team, you can be pretty certain the folks working in the trenches know the details of their work better than you do. This means that although you might be the one driving the team to consensus and helping to set the direction, the nuts and bolts of how to accomplish your goals are best decided by the people who are putting the product together. This gives them not only a greater sense of ownership, but also a greater sense of accountability and responsibility for the success (or failure) of their product. If you have a good team and you let it set the bar for the quality and rate of its work, it will accomplish more than by you standing over team members with a carrot and a stick.(如果你没有对你的团队进行微观管理,你可以非常肯定,那些在基层工作的人比你更了解他们工作的细节。这意味着,尽管你可能是推动团队达成共识并帮助确定方向的人,但如何完成你的目标的具体细节最好是由正在制作产品的人决定。这不仅使他们有更大的主人翁意识,而且对他们产品的成功(或失败)也有更大的责任感和使命感。如果你有一个好的团队,并让它为其工作的质量和速度设定标准,它将比你拿着胡萝卜和大棒站在团队成员面前的成就更大。) A simple way to visualize this effect is to see your company’s organization chart as a chain of gears, with the individual contributor as a tiny gear with just a few teeth all the way at one end, and each successive manager above them as another gear, ending with the CEO as the largest gear with many hundreds of teeth. This means that every time that individual’s “manager gear” (with maybe a few dozen teeth) makes a single revolution, the “individual’s gear” makes two or three revolutions. And the CEO can make a small movement and send the hapless employee, at the end of a chain of six or seven gears, spinning wildly! The farther you move up the chain, the faster you can set the gears below you spinning, whether or not you intend to.(将这种效应形象化的一个简单方法是将你公司的组织结构图看作是一个齿轮链,个人是一个很小的齿轮,只有几个齿,而他们之上的每个继任经理都是另一个齿轮,最后CEO是有数百颗牙的最大齿轮。这意味着个人的 "经理齿轮"(可能有几十个齿)每转一圈,"个人的齿轮 "就转两三圈。而首席执行官可以做一个小动作,让处于六、七个齿轮链末端的无助的员工疯狂地旋转!你越是往上走,就越是如此。你在链条上走得越远,你就能让你下面的齿轮转得越快,无论你是否打算这样做。) This brings us to another Zen management trick: asking questions. When a team member asks you for advice, it’s usually pretty exciting because you’re finally getting the chance to fix something. That’s exactly what you did for years before moving into a leadership position, so you usually go leaping into solution mode, but that is the last place you should be. The person asking for advice typically doesn’t want you to solve their problem, but rather to help them solve it, and the easiest way to do this is to ask this person questions. This isn’t to say that you should replace yourself with a Magic 8 Ball, which would be maddening and unhelpful. Instead, you can apply some humility, respect, and trust and try to help the person solve the problem on their own by trying to refine and explore the problem. This will usually lead the employee to the answer,[^6] and it will be that person’s answer, which leads back to the ownership and responsibility we went over earlier in this chapter. Whether or not you have the answer, using this technique will almost always leave the employee with the impression that you did. Tricky, eh? Socrates would be proud of you.(这给我们带来了另一个管理自我技巧:问问题。当一个团队成员向你征求意见时,这通常是非常令人兴奋的,因为你终于有机会解决一些问题了。这正是你在进入领导岗位之前多年所做的事情,所以你通常会立即进入解决方案模式,但这是你最不应该做的。寻求建议的人通常不希望你解决他们的问题,而是希望你能帮助他们解决问题,而最简单的方法就是向这个人提问。这并不是说你应该用 "魔力8球 "来代替你自己,那样做会让人发疯,而且没有帮助。相反,你可以运用一些谦逊、尊重和信任,通过尝试完善和探索问题,尝试帮助这个人自己解决这个问题。这通常会引导员工找到答案,而且这将是这个人的答案,这又回到了我们在本章前面所讲的所有权和责任。无论你是否有答案,使用这种技巧几乎总是会给员工留下你有答案的印象。很狡猾,是吗?苏格拉底会为你感到骄傲的。) One of the most common things a team leader does is to build consensus. This might mean that you drive the process from start to finish, or you just give it a gentle push in the right direction to speed it up. Working to build team consensus is a leadership skill that is often used by unofficial leaders because it’s one way you can lead without any actual authority. If you have the authority, you can direct and dictate direction, but that’s less effective overall than building consensus.[^7] If your team is looking to move quickly, sometimes it will voluntarily concede authority and direction to one or more team leads. Even though this might look like a dictatorship or oligarchy, when it’s done voluntarily, it’s a form of consensus.(团队领导最常做的事情之一是建立共识。这可能意味着你从头到尾推动这个过程,或者你只是在正确的方向上轻轻地推动它以加速它。努力建立团队共识是一种领导技能,经常被非官方领导人使用,因为这是你可以在没有任何实际权力的情况下进行领导的一种方式。如果你有权力,你可以指挥和发号施令,但这在整体上不如建立共识有效。如果你的团队希望快速行动,有时会自愿将权力和方向让给一个或多个团队领导。尽管这可能看起来像独裁或寡头政治,但当它是自愿做的时候,它是一种共识的形式。) Attempting to achieve 100% consensus can also be harmful. You need to be able to decide to proceed even if not everyone is on the same page or there is still some uncertainty.( 试图达成100%的共识也可能是有害的。你需要能够决定继续进行,即使不是每个人都在同一起跑线上,或者仍有一些不确定性。) Much like the role of manager, most people don’t apply for the role of mentor—they usually become one when a leader is looking for someone to mentor a new team member. It doesn’t take a lot of formal education or preparation to be a mentor. Primarily, you need three things: experience with your team’s processes and systems, the ability to explain things to someone else, and the ability to gauge how much help your mentee needs. The last thing is probably the most important—giving your mentee enough information is what you’re supposed to be doing, but if you overexplain things or ramble on endlessly, your mentee will probably tune you out rather than politely tell you they got it.(与经理的角色一样,大多数人并不申请担任导师的角色——他们通常在领导寻找指导新团队成员的人时成为导师。要成为一名导师,不需要很多正式的教育或准备。主要来说,你需要三件事:对团队的流程和系统的经验,向别人解释事情的能力,以及衡量被指导者需要多少帮助的能力。最后一点可能是最重要的——向被指导者提供足够的信息是你应该做的,但是如果你说得太多或者没完没了,被指导者可能会把你拒之门外,而不是礼貌地告诉你他们明白了。) This doesn’t mean that we’re assuming you are lying to your team, but it merits a mention because you’ll inevitably find yourself in a position in which you can’t tell your team something or, even worse, you need to tell everyone something they don’t want to hear. One manager we know tells new team members, “I won’t lie to you, but I will tell you when I can’t tell you something or if I just don’t know.”(这并不意味着我们假设你在对你的团队撒谎,但值得一提的是,你将不可避免地发现自己处于一种无法告诉团队的境地,或者更糟糕的是,你需要告诉每个人他们不想听的事情。我们认识的一位经理告诉新团队成员,“我不会对你们撒谎,但当我不能告诉你们一些事情或者我只是不知道的什么时候,可以告诉你们。”) A good simple way to track your team’s happiness[^8] is to ask the team member at the end of each one-on-one meeting, “What do you need?” This simple question is a great way to wrap up and make sure each team member has what they need to be productive and happy, although you might need to carefully probe a bit to get details. If you ask this every time you have a one-on-one, you’ll find that eventually your team will remember this and sometimes even come to you with a laundry list of things it needs to make everyone’s job better.(跟踪你的团队幸福感的一个好的简单方法是在每次一对一的会议结束时问团队成员:"你需要什么?" 这个简单的问题是一个很好的总结方式,确保每个团队成员都有他们需要的东西,以提高工作效率和幸福感,尽管你可能需要仔细探究一下以获得细节。如果你在每次一对一会谈时都这样问,你会发现最终你的团队会记住这一点,有时甚至会带着一长串需要的东西来找你,以使每个人的工作变得更好。) 下面是谷歌在你担任领导职务时推荐的其他提示和窍门: 委托,但要弄脏自己的手 当从个人贡献者的角色转变为领导角色时,实现平衡是最难做到的事情之一。起初,你会倾向于自己做所有的工作,而在领导岗位上呆久了,很容易养成自己不做任何工作的习惯。如果你刚开始担任领导职务,你可能需要努力工作,把工作委托给团队中的其他工程师,即使他们完成这项工作所需的时间比你长很多。这不仅是你保持理智的一种方式,而且也是你的团队其他成员学习的方式。如果你已经领导了一段时间的团队,或者你接了一个新的团队,获得团队的尊重和了解他们的工作的最简单的方法之一就是弄脏你的手——通常是承担一个别人不愿意做的肮脏的任务。你可以有一份简历和一份一英里长的成就清单,但没有任何东西能让团队知道你有多熟练、有多谦逊(和谦逊),你喜欢跳进去做一些艰苦的工作。 寻求继任者 除非你想在余下的职业生涯中一直做着完全相同的工作,否则要设法寻找继任者。正如我们前面提到的,这从招聘过程开始:如果你想让你的团队成员取代你,你需要雇佣有能力取代你的人,我们通常总结说,你需要 "雇佣比你更聪明的人"。在你拥有能够胜任工作的团队成员之后,你需要给他们机会承担更多的责任或偶尔领导团队。如果你这样做,你会很快看到谁最有领导才能,以及谁想领导团队。请记住,有些人更愿意只做高绩效的个人,这也是可以的。我们一直对一些公司感到惊讶,这些公司把他们最优秀的工程师,违背他们的意愿,把这些工程师扔到管理岗位上。这通常会从你的团队中减少一名优秀的工程师,而增加一名不合格的经理。 知道什么时候该掀起风波 你会(不可避免且经常地)遇到一些困难的情况,在这些情况下,你身体里的每一个细胞都在对你大喊大叫,要求你什么都不要做。这可能是你团队中的工程师,他的技术能力达不到要求。它可能是那个在每辆火车前跳来跳去的人。它可能是每周工作30小时的无心的员工。"只要等一等,就会好起来的,"你会告诉自己。"它会自己解决的,"你会合理地解释。不要落入这个陷阱——这些是你需要掀起最大波澜的情况,你需要现在就掀起。这些问题很少会自己解决,你等待解决的时间越长,它们对团队其他成员的不利影响就越大,它们会让你彻夜思考。通过等待,你只是拖延了不可避免的事情,并在这个过程中造成难以言喻的损失。因此,要采取行动,而且要迅速行动。 屏蔽团队免受混乱影响 当你步入领导岗位时,你通常会发现,在你的团队之外是一个混乱和不确定(甚至是疯狂)的世界,而你在做个人贡献者时从未见过。当我在20世纪90年代第一次成为一名经理时(在回到个人贡献者之前),我对公司里发生的大量不确定性和组织混乱感到吃惊。我问另一位经理,是什么原因导致原本平静的公司突然出现这种动荡,另一位经理歇斯底里地笑我太天真了:混乱一直存在,但我以前的经理把我和我的团队其他成员都挡在外面。 给你的团队提供空中掩护 尽管让你的团队了解公司 "上面 "发生的事情很重要,但同样重要的是,你要保护他们不受很多不确定因素和轻率要求的影响,这些要求可能来自你的团队之外。尽可能多地与你的团队分享信息,但不要用那些极不可能真正影响到他们的组织的疯狂行为来分散他们的注意力。 让你的团队知道他们什么时候做得好 许多新的团队领导可能会陷入处理团队成员的缺点中,以至于他们忽略了经常提供积极的反馈。就像你让某人知道他们搞砸了一样,一定要让他们知道他们做得很好,而且一定要让他们(和团队其他成员)知道他们在球场里踢出了一个好成绩。   There are two types of motivation: extrinsic, which originates from outside forces (such as monetary compensation), and intrinsic, which comes from within. In his book Drive,[^10] Dan Pink explains that the way to make people the happiest and most productive isn’t to motivate them extrinsically (e.g., throw piles of cash at them); rather, you need to work to increase their intrinsic motivation. Dan claims you can increase intrinsic motivation by giving people three things: autonomy, mastery, and purpose.(有两种类型的动机:外部动机,来源于外部力量(如金钱补偿),和内部动机,来源于内部。丹-平克在他的书《驱动》中解释说,让人们成为最快乐、最有效率的人的方法不是外在地激励他们(例如,向他们扔大量现金);相反,你需要努力提高他们的内在动机。丹声称,你可以通过给人们三样东西来增加内在动机:自主性、掌控力和目标。)

《Software Engineering at Google》摘抄(4)

by kevin 31. 八月 2022 13:55 >
We are also writing this chapter because of the increasing imbalance of power between those who make development decisions that impact the world and those who simply must accept and live with those decisions that sometimes disadvantage already marginalized communities globally. It is important to share and reflect on what we’ve learned so far with the next generation of software engineers. It is even more important that we help influence the next generation of engineers to be better than we are today.(我们之所以要写这一章,也是因为在那些做出影响世界发展的人和那些只能选择接受并忍受这些决定的人之间,力量越来越不平衡,这些决定有时使全球已经处于边缘地位的社会处于不利地位。与下一代软件工程师分享和反思我们迄今所学到的知识是很重要的。更重要的是,我们帮助影响下一代工程师,使他们比我们今天做得更好。) When engineers do not focus on users of different nationalities, ethnicities, races, genders, ages, socioeconomic statuses, abilities, and belief systems, even the most talented staff will inadvertently fail their users. Such failures are often unintentional; all people have certain biases, and social scientists have recognized over the past several decades that most people exhibit unconscious bias, enforcing and promulgating existing stereotypes. Unconscious bias is insidious and often more difficult to mitigate than intentional acts of exclusion. Even when we want to do the right thing, we might not recognize our own biases. By the same token, our organizations must also recognize that such bias exists and work to address it in their workforces, product development, and user outreach.(当工程师不关注不同国籍、民族、种族、性别、年龄、社会经济地位、能力和信仰体系的用户时,即使是最优秀的工程师也会在不经意间让用户失望。这种失败往往是无意的;所有的人都存在一定的偏见,社会科学家在过去几十年中已经认识到,大多数人都表现出无意识的偏见,强迫和传播存在的刻板印象。无意识的偏见是隐藏的,往往比有意的排斥行为更难改正。即使我们想做正确的事,我们也可能意识不到自己的偏见。同样,我们的组织也必须认识到这种偏见的存在,并努力在员工队伍、产品开发和用户推广中解决这一问题。) Therefore, shifting the focus of your industry experience to include more comprehensive, multicultural, race and gender studies education is not only your responsibility, but also the responsibility of your employer. Technology companies must ensure that their employees are continually receiving professional development and that this development is comprehensive and multidisciplinary. The requirement is not that one individual take it upon themselves to learn about other cultures or other demographics alone. Change requires that each of us, individually or as leaders of teams, invest in continuous professional development that builds not just our software development and leadership skills, but also our capacity to understand the diverse experiences throughout humanity.(因此,将你的行业经验的重点转移到更全面的、多文化的、种族和性别研究的教育,不仅是你的责任,也是你雇主的责任。科技公司必须确保他们的员工不断接受专业发展,而且这种发展是全面和多学科的。要求不是个体独自承担起学习其他文化或其他人口统计学的任务。变革要求我们每个人,无论是个人还是团队的领导者,都要投资于持续的专业发展,不仅要培养我们的软件开发和领导技能,还要培养我们理解全人类不同经验的能力。) Designing for the user who is least like you is not just wise, it’s a best practice. There are pragmatic and immediate next steps that all technologists, regardless of domain, should consider when developing products that avoid disadvantaging or underrepresenting users. It begins with more comprehensive user-experience research. This research should be done with user groups that are multilingual and multicultural and that span multiple countries, socioeconomic class, abilities, and age ranges. Focus on the most difficult or least represented use case first.(为最不喜欢你的用户设计不仅是明智的,而且是最佳实践。所有的技术专家,无论在哪个领域,在开发产品时都应该考虑一些实用的和直接的步骤,以避免对用户造成不利影响或代表不足。它从更全面的用户体验研究开始。这项研究应该针对多语言、多文化、跨多个国家、社会经济阶层、能力和年龄范围的用户群体进行。首先关注最困难或最不典型的用例。) The path to equity is long and complex. However, we can and should transition from simply building tools and services to growing our understanding of how the products we engineer impact humanity. Challenging our education, influencing our teams and managers, and doing more comprehensive user research are all ways to make progress. Although change is uncomfortable and the path to high performance can be painful, it is possible through collaboration and creativity.(通往公平的道路是道阻且长。然而,我们可以也应该从简单地构建工具和服务过渡到加深我们对我们设计的产品如何影响人类的理解。挑战我们的教育,影响我们的团队和管理者,以及做更全面的用户研究,都是取得进展的方法。虽然改变是痛苦的,而且通向高绩效的道路可能是痛苦的,但通过合作和创新,变革是可能的。) Lastly, as future exceptional engineers, we should focus first on the users most impacted by bias and discrimination. Together, we can work to accelerate progress by focusing on Continuous Improvement and owning our failures. Becoming an engineer is an involved and continual process. The goal is to make changes that push humanity forward without further disenfranchising the disadvantaged. As future exceptional engineers, we have faith that we can prevent future failures in the system.(最后,作为未来的杰出工程师,我们应该首先关注受偏见和歧视影响最大的用户。通过共同努力,我们可以通过专注于持续改进和承认失败来加速进步。成为一名工程师是一个复杂而持续的过程。目标是在不进一步剥夺弱势群体权利的情况下,做出推动人类前进的变革。作为未来杰出的工程师,我们有信心能够防止未来系统的失败。)

《Software Engineering at Google》摘抄(3)

by kevin 26. 八月 2022 14:00 >
Your organization understands your problem domain better than some random person on the internet; your organization should be able to answer most of its own questions. To achieve that, you need both experts who know the answers to those questions and mechanisms to distribute their knowledge, which is what we’ll explore in this chapter. These mechanisms range from the utterly simple (Ask questions; Write down what you know) to the much more structured, such as tutorials and classes. Most importantly, however, your organization needs a culture of learning, and that requires creating the psychological safety that permits people to admit to a lack of knowledge.(你的组织对你问题领域的理解比互联网上的一些随机的人要好;你的组织应该能解答你的大部分问题。要做到这一点,你需要知道解决问题答案的专家在哪里和传播知识的机制,这就是我们将在本章中探讨的。这些机制的范围很广,从完全简单的(提问;写下你所知道的)到系统化,如教程和课程。然而,最重要的是,你的组织需要一种学习文化,这需要创造一种心理上的安全感,允许人们承认自己缺乏知识。) 在一个组织内共享专业知识并非易事。没有强大的学习文化,挑战随时出现。谷歌经历了许多这样的挑战,尤其是随着公司规模的扩大: 缺乏安全感 一个环境中,人们不敢在别人面前冒险或犯错,因为他们害怕因此受到惩罚。这通常表现为一种恐惧文化或避免透明的倾向。 信息孤岛 在一个组织的不同部分发生的知识碎片,这些部分没有相互沟通或使用共享资源。在这样的环境中,每个小组都形成了自己的做事方式。这往往导致以下情况: 信息碎片化 每个孤岛对整体都有一个不完整的描述。 信息重复 每个孤岛都重新发明了自己的做事方式。 信息偏移 每个孤岛都有自己做同一件事的方法,这些方法在一起协作可能会或可能不会发生冲突。 单点故障(SPOF) 当关键信息只能从一个人那里获得时,就会出现瓶颈。这与巴士因子有关,在第二章有详细讨论。 SPOF可能是出于良好的意图:我们很容易陷入 "让我来帮你解决 "的习惯。但这种方法提高了短期效率("我做起来更快"),但代价是长期可扩展性差(团队从未学会如何做需要做的事)。这种心态也往往导致失败,组员要么全会或要么都不会某方面的知识。 要么全会要么都不会 一群人被分成了 "什么都懂 "的老人和什么都不会的新手,几乎没有中间地带。如果专家总是自己做所有的事情,而不花时间通过指导或编写文档来培养新的专家,这个问题往往会加剧。在这种情况下,知识和责任继续在那些已经拥有专业知识的人身上积累,而新的团队成员或新手则只能自生自灭,提升速度更慢。 鹦鹉学舌 模仿而不理解。这典型的特征是在不了解其目的的情况下无意识地复制模式或代码,通常是在假设上述代码是出于未知原因而需要的情况下。 闹鬼墓地 人们避免接触或改变的地方,通常在代码中,因为他们担心会出问题。与前面提到的鹦鹉学舌不同,闹鬼墓地的特点是人们因为恐惧和迷信而避免行动。   Software engineering can be defined as the multiperson development of multiversion programs.[^2] People are at the core of software engineering: code is an important output but only a small part of building a product. Crucially, code does not emerge spontaneously out of nothing, and neither does expertise. Every expert was once a novice: an organization’s success depends on growing and investing in its people.(软件工程可以定义为多人协作开发多版本程序。人是软件工程的核心:代码是重要的产出,但只是构建产品的一小部分。至关重要的是,代码不是凭空出现的,专业知识也不会凭空出现。每个专家都曾经是菜鸟:一个组织的成功取决于其员工的成长和投入。) Psychological safety is critical to promoting a learning environment.(心理安全是促进学习环境的关键。) 这些反模式可能是无意中出现的:有人可能是想帮忙,但却意外地居高临下,不受欢迎。我们发现Recurse中心的社交规则在这里很有帮助: 不要假装惊讶("什么? 我不相信你不知道堆栈是什么!") 假装惊讶是心理安全的障碍,使团体成员害怕承认自己缺乏知识。 不根据事实 迂腐的纠正,往往是为了哗众取宠而非纠正。 不开小会 打断现有的讨论,提供意见,而不投入到对话中。 不说微妙的谎言("这太容易了,我奶奶都能做!") 小小的偏见表达(种族主义、年龄歧视、恐同症),会使个人感到不受欢迎、不被尊重或不安全。 It doesn’t matter whether you’re new to a team or a senior leader: you should always be in an environment in which there’s something to learn. If not, you stagnate (and should find a new environment).(不管你是新加入的团队还是高级领导者:你应该始终处在一个有东西可学的环境中。如果不是这样,你就会停滞不前(应该找一个新的环境)。) Consider the principle of “Chesterson’s fence”: before removing or changing something, first understand why it’s there. In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be called a paradox. There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, “I don’t see the use of this; let us clear it away.” To which the more intelligent type of reformer will do well to answer: “If you don’t see the use of it, I certainly won’t let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it.”(考虑一下 "Chesterson's fence "的原则:在移除或改变某些东西之前,首先要了解它为什么存在。 在改造事物的问题上,不同于使事物变形,有一个简单明了的原则;这个原则可能会被称为悖论。在这种情况下,存在着某种制度或法律;为了简单起见,让我们说,在一条道路上竖起了栅栏或大门。更现代的改革者兴高采烈地走到它面前,说:"我看不出来这有什么用;让我们把它清除掉吧。" 对此,更聪明的改革者会很好地回答。"如果你看不到它的用途,我当然不会让你清除它。走吧,好好想想。然后,当你能回来告诉我你确实看到了它的用途时,我才会允许你销毁它。") A system in which people can formally and easily recognize their peers is a powerful tool for encouraging peers to keep doing the awesome things they do. It’s not the bonus that matters: it’s the peer acknowledgement.(一个人们可以正式和容易地认可他们的同行系统是一个强大的工具,可以鼓励同行继续做他们所做的了不起的事情。重要的不是奖金:而是同行的认可。) One of the primary advantages of the readability program is that it exposes engineers to more than just their own team’s tribal knowledge. To earn readability in a given language, engineers must send CLs through a centralized set of readability reviewers who review code across the entire company. Centralizing the process makes a significant trade-off: the program is limited to scaling linearly rather than sublinearly with organization growth, but it makes it easier to enforce consistency, avoid islands, and avoid (often unintentional) drifting from established norms.(可读性项目的主要优势之一是,它让工程师接触到的不仅仅是他们自己团队的内部知识。为了获得特定语言的可读性,工程师们必须将 CLs 发送给一组集中的可读性审查员,他们审查整个公司的代码。将流程集中化会带来显著的折衷:该计划仅限于随着组织的发展而线性扩展,而不是次线性扩展,但它更容易实现一致性,避免孤岛,并避免(通常是无意的)偏离既定规范。)   Knowledge is in some ways the most important (though intangible) capital of a software engineering organization, and sharing of that knowledge is crucial for making an organization resilient and redundant in the face of change. A culture that promotes open and honest knowledge sharing distributes that knowledge efficiently across the organization and allows that organization to scale over time. In most cases, investments into easier knowledge sharing reap manyfold dividends over the life of a company.(在某些方面,知识是软件工程组织最重要的(尽管是无形的)资产,而知识的共享对于使组织在面对变化时具有弹性和冗余至关重要。一种促进开放和诚实的知识共享的文化可以在整个组织内有效地分配这些知识,并使该组织能够随着时间的推移而扩展。在大多数情况下,对更容易的知识共享的投入会在一个公司的生命周期中获得许多倍的回报。)

《Software Engineering at Google》摘抄(2)

by kevin 15. 八月 2022 17:21 >
The answer is insecurity. People are afraid of others seeing and judging their work in progress. In one sense, insecurity is just a part of human nature—nobody likes to be criticized, especially for things that aren’t finished. Recognizing this theme tipped us off to a more general trend within software development: insecurity is actually a symptom of a larger problem.(答案是缺乏安全感。人们害怕别人看到和评价他们正在进行的工作。从某种意义上说,缺乏安全感是人性的一部分——没有人喜欢被批评,尤其是那些没有完成的事情。认识到这个主题让我们看到了软件开发中一个更普遍的趋势:缺乏安全实际上是一个更大问题的征兆。) Deep down, many engineers secretly wish to be seen as geniuses. This fantasy goes something like this: You are struck by an awesome new concept. You vanish into your cave for weeks or months, slaving away at a perfect implementation of your idea. You then “unleash” your software on the world, shocking everyone with your genius. Your peers are astonished by your cleverness. People line up to use your software. Fame and fortune follow naturally. 在内心深处,许多工程师暗中希望被视为天才。这种幻想是这样的: 你会被一个了不起的新概念所震撼。 你消失数周或数月躲在洞穴中,努力实现你的理想。 然后世界上“发布”你的软件,用你的天才震撼每个人。 你的同龄人对你的聪明感到惊讶。 人们排队使用你的软件。 名利自然随之而来。 It turns out that this Genius Myth is just another manifestation of our insecurity. Many programmers are afraid to share work they’ve only just started because it means peers will see their mistakes and know the author of the code is not a genius.(事实证明,这种天才神话只是我们缺乏安全感的另一种表现。许多程序员害怕分享他们刚刚开始的工作,因为这意味着同行会看到他们的错误,知道代码的作者不是天才。) To quote a friend: I know I get SERIOUSLY insecure about people looking before something is done. Like they are going to seriously judge me and think I’m an idiot.(引用一位朋友的话: 我知道,别人在我完成某事之前就来看,会让我感到非常不安全。好像他们会认真地评判我,认为我是个白痴。) How dispersed is the knowledge and know-how in your project? If you’re the only person who understands how the prototype code works, you might enjoy good job security—but if you get hit by a bus, the project is toast. If you’re working with a colleague, however, you’ve doubled the bus factor. And if you have a small team designing and prototyping together, things are even better—the project won’t be marooned when a team member disappears. Remember: team members might not literally be hit by buses, but other unpredictable life events still happen. Someone might get married, move away, leave the company, or take leave to care for a sick relative. Ensuring that there is at least good documentation in addition to a primary and a secondary owner for each area of responsibility helps future-proof your project’s success and increases your project’s bus factor. Hopefully most engineers recognize that it is better to be one part of a successful project than the critical part of a failed project.(你的项目中的知识和技能分散程度如何?如果你是唯一了解原型代码工作原理的人,你需要会受到良好的工作保障,但如果你被公交车撞倒,项目就完蛋了。但是,如果你与同事合作,你的巴士因子就翻了一番。如果你有一个小团队一起进行设计和制作原型,情况会更好——当团队某个成员消失时,项目不会被孤立。记住:团队成员可能不会被公交车撞到,但其他不可预知的事件仍然会发生。有人可能会结婚、搬走、离开公司或请假照顾生病的亲属。确保每个责任领域除了一个主要和一个次要所有者之外,至少还有可用的文档,这有助于确保项目的成功,提高项目的成功率。希望大多数工程师认识到,成为成功项目的一部分比成为失败项目的关键部分要好。) We think the middle ground is really the best solution. Group teams of four to eight people together in small rooms (or large offices) to make it easy (and non- embarrassing) for spontaneous conversation to happen.(我们觉得折中的方案是最好的解决方法。在小房间(或大办公室)将四至八人组成小组,方便大家轻松(且不令人尴尬)地自由对话。) Don’t misunderstand us—we still think engineers need uninterrupted time to focus on writing code, but we think they need a high-bandwidth, low-friction connection to their team just as much. If less-knowledgeable people on your team feel that there’s a barrier to asking you a question, it’s a problem: finding the right balance is an art.(不要误解我们,我们仍然认为工程师需要不受打扰的时间来专注于编写代码,但我们认为他们同样需要一个高带宽、低冲突的团队连接。如果你的团队中新人觉得向你提问存在障碍,那就是一个问题:找到正确的平衡是一门艺术。) The point we’ve been hammering away at is that, in the realm of programming, lone craftspeople are extremely rare—and even when they do exist, they don’t perform superhuman achievements in a vacuum; their world-changing accomplishment is almost always the result of a spark of inspiration followed by a heroic team effort.(我们反复强调的一点是,在编程领域,孤独的工匠极其罕见,即使他们确实存在,他们也不会在真空中完成超人的成就;他们改变世界的成就几乎总是灵感迸发、团队英勇努力的结果。) A great team makes brilliant use of its superstars, but the whole is always greater than the sum of its parts. But creating a superstar team is fiendishly difficult.(一个伟大的团队能够出色地利用它的超级明星,但整体总是大于各部分的总和。但打造一支集合多个超级明星球队是极其困难的。) Let’s put this idea into simpler words: software engineering is a team endeavor.(让我们把这个想法用更简单的话来说:软件工程是一个团队的努力。) The moral is this: do not underestimate the power of playing the social game. It’s not about tricking or manipulating people; it’s about creating relationships to get things done. Relationships always outlast projects. When you’ve got richer relationships with your coworkers, they’ll be more willing to go the extra mile when you need them.(寓意是:不要低估社交游戏的力量。这不是欺骗或操纵人们;这是关于建立关系来完成事情。关系总是比项目更长久。当你和你的同事关系更融洽时,他们会更愿意在你需要他们的时候帮助你。) In a professional software engineering environment, criticism is almost never personal—it’s usually just part of the process of making a better project. The trick is to make sure you (and those around you) understand the difference between a constructive criticism of someone’s creative output and a flat-out assault against someone’s character. The latter is useless—it’s petty and nearly impossible to act on. The former can (and should!) be helpful and give guidance on how to improve. And, most important, it’s imbued with respect: the person giving the constructive criticism genuinely cares about the other person and wants them to improve themselves or their work. Learn to respect your peers and give constructive criticism politely. If you truly respect someone, you’ll be motivated to choose tactful, helpful phrasing—a skill acquired with much practice. 在专业的软件工程环境中,批评几乎从来不是针对个人的,它通常只是构建更好项目过程的一部分。诀窍是确保你(和你周围的人)理解对某人的创造性产出进行建设性批评和对某人的人身攻击之间的区别。后者是无用的——它是琐碎,几乎不可能采取行动。前者可以(也应该!)提供帮助并指导如何改进。而且,最重要的是,它充满了尊重:给予建设性批评的人真正关心对方,希望他们提升自己或工作。学会尊重同龄人,礼貌地提出建设性的批评。如果你真的尊重别人——这是一种通过大量实践获得的技能。) A good postmortem should include the following: A brief summary of the event A timeline of the event, from discovery through investigation to resolution The primary cause of the event Impact and damage assessment A set of action items (with owners) to fix the problem immediately A set of action items to prevent the event from happening again Lessons learned 一个好的事后总结应该包括以下内容: 事件的简要概述 事件的时间线,从发现、调查到解决的过程 事件的主要原因 影响和损害评估 一套立即解决该问题的行动项目(包括执行人)。 一套防止事件再次发生的行动项目 经验教训 Be aware of the trade-offs of working in isolation. Acknowledge the amount of time that you and your team spend communicating and in interpersonal conflict. A small investment in understanding personalities and working styles of yourself and others can go a long way toward improving productivity. If you want to work effectively with a team or a large organization, be aware of your preferred working style and that of others. 意识到孤立工作的得失。 认识到你和你的团队花在沟通和人际冲突上的时间。在了解自己和他人的个性和工作风格方面进行少量投入,对提高生产力有很大帮助。 如果你想在一个团队或一个大型组织中有效地工作,要意识到你和其他人喜欢的工作风格。

《Software Engineering at Google》摘抄(1)

by kevin 14. 八月 2022 10:37 >
We propose that “software engineering” encompasses not just the act of writing code, but all of the tools and processes an organization uses to build and maintain that code over time.(我们建议,"软件工程 "不仅包括编写代码的行为,还包括一个组织用来长期构建和维护代码的所有工具和流程。) The book emphasizes three fundamental principles that we feel software organizations should keep in mind when designing, architecting, and writing their code: Time and Change How code will need to adapt over the length of its life Scale and Growth How an organization will need to adapt as it evolves Trade-offs and Costs How an organization makes decisions, based on the lessons of Time and Change and Scale and Growth(本书强调了三个基本原则,我们认为软件组织在设计、架构和编写代码时应该牢记这些原则: 时间和变化​代码如何展期生命周期内进行适配。 规模和增长​一个组织如何适应它的发展过程。 权衡和成本​一个组织如何根据时间和变化以及规模和增长的经验教训做出决策。) We see three critical differences between programming and software engineering: time, scale, and the trade-offs at play. On a software engineering project, engineers need to be more concerned with the passage of time and the eventual need for change. In a software engineering organization, we need to be more concerned about scale and efficiency, both for the software we produce as well as for the organization that is producing it. Finally, as software engineers, we are asked to make more complex decisions with higher-stakes outcomes, often based on imprecise estimates of time and growth.(我们看到,编程和软件工程之间有三个关键的区别:时间、规模和权衡取舍。在一个软件工程项目中,工程师需要更多关注时间成本和需求变更。在软件工程中,我们需要更加关注规模和效率,无论是对我们生产的软件,还是对生产软件的组织。最后,作为软件工程师,我们被要求做出更复杂的决策,其结果风险更大,而且往往是基于对时间和规模增长的不确定性的预估。) We can also say that software engineering is different from programming in terms of the complexity of decisions that need to be made and their stakes. In software engineering, we are regularly forced to evaluate the trade-offs between several paths forward, sometimes with high stakes and often with imperfect value metrics. The job of a software engineer, or a software engineering leader, is to aim for sustainability and management of the scaling costs for the organization, the product, and the development workflow . With those inputs in mind, evaluate your trade-offs and make rational decisions. We might sometimes defer maintenance changes, or even embrace policies that don’t scale well, with the knowledge that we’ll need to revisit those decisions. Those choices should be explicit and clear about the deferred costs.(我们还可以说,软件工程与编程的不同之处在于需要做出的决策的复杂性及其风险。在软件工程中,我们经常被迫在几个路径之间做评估和权衡,有时风险很高,而且价值指标不完善。软件工程师或软件工程负责人的工作目标是实现组织、产品和开发工作流程的可持续性和管理扩展成本为目标。考虑到这些投入,评估你的权衡并做出理性的决定。有时,我们可能会推迟维护更改,甚至接受扩展性不好的策略,因为我们知道需要重新审视这些决策。这些决策应该是明确的和清晰的递延成本。) So, concretely, how does short-term programming differ from producing code with a much longer expected life span? Over time, we need to be much more aware of the difference between “happens to work” and “is maintainable.” There is no perfect solution for identifying these issues. That is unfortunate, because keeping software maintainable for the long-term is a constant battle.(那么,具体来说,短期编程与生成预期生命周期更长的代码有何不同?随着时间的推移,我们需要更多地意识到“正常工作”和“可维护”之间的区别。识别这些问题没有完美的解决方案。这是不幸的,因为保持软件的长期可维护性是一场持久战。) If you are maintaining a project that is used by other engineers, the most important lesson about “it works” versus “it is maintainable” is what we’ve come to call Hyrum’s Law: With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.(如果你正在维护一个由其他工程师使用的项目,那么关于“有效”与“可维护”最重要的一课就是我们所说的海勒姆定律: 当一个 API 有足够多的用户的时候,在约定中你承诺的什么都无所谓,所有在你系统里面被观察到的行为都会被一些用户直接依赖。) Everything your organization relies upon to produce and maintain code should be scalable in terms of overall cost and resource consumption. In particular, everything your organization must do repeatedly should be scalable in terms of human effort. Many common policies don’t seem to be scalable in this sense.(你的组织生产和维护代码所依赖的一切都应该在总体成本和资源消耗方面具有可扩展性。特别是,你的组织必须重复做的每件事都应该在人力方面具有可扩展性。从这个意义上讲,许多通用策略似乎不具有可扩展性。) This type of approach might work in a small software setting but quickly fails as both the depth and breadth of the dependency graph increases. Teams depend on an ever- increasing number of Widgets, and a single build break can affect a growing percentage of the company. Solving these problems in a scalable way means changing the way we do deprecation: instead of pushing migration work to customers, teams can internalize it themselves, with all the economies of scale that provides.(这种方法可能适用于小型软件项目,但随着依赖关系图的深度和广度的增加,很快就会失败。团队依赖越来越多的小部件,单个构建中断可能会影响公司不断增长的百分比。以一种可扩展的方式解决这些问题,意味着需要改变我们废弃的方式: 不是将迁移工作推给客户,团队可以将其内部消化,并提供所需资源投入。) One of the broad truths we’ve seen to be true is the idea that finding problems earlier in the developer workflow usually reduces costs. Consider a timeline of the developer workflow for a feature that progresses from left to right, starting from conception and design, progressing through implementation, review, testing, commit, canary, and eventual production deployment. Shifting problem detection to the “left” earlier on this timeline makes it cheaper to fix than waiting longer, as shown in Figure 1-2.(我们看到的一个普遍真理是,在开发人员的工作流程中发现的问题,通常可以降低成本。考虑开发人员工作流程的时间表,从左到右,从概念和设计开始,通过实施、评审、测试、提交、金丝雀和最终的生产部署来进行。在此时间线之前,将问题发现转移到“左侧”会使修问题解决成本更低,如图1-2所示。) What do we mean by cost? We are not only talking about dollars here. “Cost” roughly translates to effort and can involve any or all of these factors: Financial costs (e.g., money) Resource costs (e.g., CPU time) Personnel costs (e.g., engineering effort) Transaction costs (e.g., what does it cost to take action?) Opportunity costs (e.g., what does it cost to not take action?) Societal costs (e.g., what impact will this choice have on society at large?) 我们所说的成本是什么呢?我们这里不仅仅是指金钱。“成本”大致可以转化为努力的方向,可以包括以下任何或所有因素: 财务成本(如金钱) 资源成本(如CPU时间) 人员成本(例如,工作量) 交易成本(例如,采取行动的成本是多少?) 机会成本(例如,不采取行动的成本是多少?) 社会成本(例如,这个选择将对整个社会产生什么影响?)

打赏请我喝果汁咯

支付宝 微信

关于我

80后,单身,平庸的程序员。

喜欢看书,乐于交友,向往旅游。

遇建Kevin

FluentData交流群:477926269

Fluentdata