原文《Think You Have A Team? You Don’t.》 - Jason Cohen
主要讲解代码评审对于团队整体的作用和意义,部分地翻译了一下。
“Team building” is a load of bull. It’s happy-talk that changes nothing. It’s a laughable trust exercise. It stifles the best developers to serve mediocrity. Suspend your judgment for the five minutes it takes you to read this essay. It isn’t all about “rah-rah, go team go.”
所谓的“Team building”不能让我们真正成为一个Team的人。
I’ll give you the punch line first. Peer code review not only finds bugs, it creates an environment where developers work together instead of in parallel. It’s team building in the real sense—people helping each other to achieve something greater than each could achieve alone.
结对代码审查不仅仅能发现bug,而且它创造了一个环境,让开发人员在一起工作,而不是“单干”。这才是真实场景中的“Team building” - 大家互相帮助,达到更高的、个体不能达到的境界。
Developers write code while squirreled away behind doors and headphones. After the architecture and interface discussions are over, code is written in isolation. Does that sound like a team to you? I’ll bet most of the code in your application has been seen by only one person. Think about that for three seconds. It’s a frightening thought. Teams supposedly work on projects together. Do you really have a team?
在架构和接口讨论完毕后,代码就被分开各自开发了。这像一个Team的行为吗?
我敢打赌你们的程序中的大部分仅仅被一个人看过。
New hires want to get into code fast and get their hands dirty but they need a safety net to make sure nothing bad happens. How do your developers handle this? Isn’t “teaching and supporting” a team activity?
新进的程序员希望尽快接触到代码并着手开始写代码,但是他又担心会不小心破坏了原先的代码,他需要一个“安全网”。
The “American Heritage Dictionary” defines “team” as “Two or more draft animals used to pull a vehicle or farm implement.” The same is true of “teamwork” in most software development organizations, too. Being a team doesn’t mean we’re merely marching in the same direction. You’re not a team just because you know everyone’s name and you eat lunch together. That’s just being acquainted. Real teams actually work together. Let’s see how peer code review can help build a real team.
查看字典可以知道,“team”的意思是“两个或多个用于牵引车辆或耕作器具的牲畜”。对于软件开发组织来说,作为一个“team”不是因为你们往同一个方向行进,也不仅仅因为你知道每个人的名字并且在一起吃午饭。真正的“team”是确实工作在一起的组织。结对代码审查可以帮助我们建设一个真正的“team”。
One Is the Loneliest Number
“It’s scary how much code I’ve written that no one else has ever seen.” I was told this by a developer who had just started using our software to do peer reviews. “The worst part is, I know it can’t all be right.” Yes, you should be scared. The average professional novelist makes nine mistakes per page. No surprise; that’s why there are editors. In fact, the 2000 Census shows that in America we have more professional editors than professional writers! So why do we expect developers to write reams of technical code without the safety net of an editor? Aren’t we guaranteeing errors?
专业的小说作家平均每页会出现9个错误。这也是为什么会有编辑的缘故。
What’s Your “Bus Number?”
A project’s “bus number” is the number of people who have to get hit by a bus until no one is left who understands the code. A startling amount of code has a bus number of one, which leads to a software process that is easily derailed. If that someone is sick, leaves the company, or really is hit by a bus, arts of a project can stall or might be implemented incorrectly.
Code review provides a safety net for both developers and managers. For managers, they like the project stability that comes from having a bus number of two or more, and developers like the comfort of knowing that someone has their back. In a real team, people look out for each other.
代码审查不仅为开发人员,而且为管理者提供了一道“安全网”。
“Those Guys Suck”
It was a large software company. A small overworked software group in Austin had been asking for additional developers; finally their wish was granted in the form of 20 developers in India. The group in Austin was annoyed. It was responsible for running the remote group and incorporating its code into the local base. “Those guys suck,” was what the Austin team said exactly, referring to the Indians. “They don’t know how to write code. And they don’t do it the way we ask them to. And they don’t write comments. Forget about comments in English, they write no comments at all!”
Austin started using code review software to check everything being done in India, right down to communicating on individual lines of code and having twoway conversations. Four weeks after the reviews started, the same developer who had told us they “suck” now said of the team, “They’re pretty cool.” “They’re doing a good job now. They just needed a little direction. We’re actually getting a lot of good code written.”
It turns out that the Indian developers were inexperienced, but they were smart and wanted to learn. Once the two factions had a mechanism for easily talking to each other about code, the knowledge transfer could begin.
The developers organized themselves into a team. All they needed was an environment of communication and a tool to make it easy. They taught each other without managerial pressure or rules or strict process controls. Working together, teaching and sharing, being happier, all without being told...sounds like a team!
开发人员把他们自己组织成了一个Team,他们只需要一个沟通的环境和一些辅助的工具,就可以在没有管理约束、规则、流程控制的情况下很好地工作在一起、互相沟通、共享知识、互相培训,并且非常开心地工作下去,这就是一个“Team”!