精华内容
下载资源
问答
  • 我的第一次Pair(PairProgramming的简称,即结对编程。后面都是用Pair代替)是在ThoughtWorks公司面试进行的。那次,他们来自英国的项目经理Andy面试我,和我一起进行Pair。Andy问我以前是否Pair过,我说:“没有,...
  • leetcode高频面试题内部结对编程资源 下面是我可以召集的进行结对编程会议的过程的记录。 :) 结对编程会话前的电子邮件 模板化电子邮件在结对编程会话发生的当天发送(周二/周四@下午 1 点,周日@上午 10 点) 模板...
  • 结对编程_结对编程的利与弊

    千次阅读 2019-01-30 23:16:07
    结对编程 我在Menlo Innovations的夏季课程 杰玛·埃文斯 ( Gemma Evans)在Unsplash上拍摄的照片 许多程序员对结对编程持怀疑态度:敏捷软件开发技术,其中两个程序员在一个工作站上工作。 这是我经常听到...

    结对编程

    我在Menlo Innovations的夏季课程

    杰玛·埃文斯Gemma Evans)Unsplash拍摄的照片

    许多程序员对结对编程持怀疑态度:敏捷软件开发技术,其中两个程序员在一个工作站上工作。

    这是我经常听到的反馈类型:

    “这似乎完全是浪费钱,因为在不同的计算机上编写的代码是两个程序员的一半 。”

    要么

    “我是一个内向的人。 我讨厌在工作中经常与合作伙伴互动。”

    这些是令人关注的问题。 在结对编程公司工作之前,我可能已经分享了这些观点。

    请参阅我的上一份工作-Menlo Innovations的软件开发-不允许您自己编写代码。 如果您正在处理生产代码,则需要一个合作伙伴。

    在和他们一起工作了几个月之后,我喝了这对编程的kool-aid。 我相信在很多情况下,结对编程是解决不同任务的一种了不起的方法。

    这就是为什么。

    优点

    #1:结对编程减少了知识之塔

    “知识之塔”或“最佳绩效者”是团队生产力受到的最大威胁。

    知识之塔就像手背一样了解整个代码库。 他们是团队在需要尽快推出功能或进行大量错误修复时所需要的人员。

    塔之所以成为问题,是因为团队过于依赖它们。 塔楼一整天都在困扰着他们,因此他们的工作环境常常变得痛苦不堪。 他们付出了额外的工作(即使在周末)。 一旦信号塔决定退出,它将使公司陷入困境,因为没人像他们一样知道代码库。

    知识之塔是危险的,自给自足的循环。 由于许多其他程序员都在向他们寻求帮助,因此,信息塔比任何人都有机会看到, 思考使用更多的代码库。 这进一步增加了他们在团队中的智力优势。

    Tower伤害了团队士气,因为程序员在他们旁边站不住脚。 另外,当他们请病假一天时,塔楼会使团队停滞不前。

    更糟的是,商业作家和技术作家经常引用错误的解决方案。

    当您阅读从Lencioni到Theil的所有内容时,他们都有战争故事,他们都在其中解雇或降职表现最好的人,并立即让他们的团队士气高涨。 他们说,如果没有掌握的知识塔,就很难进行调整,但是团队士气更为重要。 故事结局。

    这是一个有缺陷的经营理念。 惩罚表现最好的人试图为团队增值,这不仅是一种糟糕的形式,而且团队很快就会开发出新的知识塔。

    正确的解决方案是将“知识之塔”与另一个程序员配对!

    这使知识转移变得无缝。 如果您整周都有另一位程序员在塔上工作,那么塔就不会对该知识有垄断地位

    他们可能仍然是您表现最好的人 ,但是当表现最好的人请病假或决定离开另一家公司时,不会有负面影响。 塔的对编程合作伙伴将能够将关键信息传达给团队的其他成员。

    如果您每周一次将与知识塔配对在一起,那么每个程序员都将共享一些关键信息,并且对团队很重要。 从而提高团队士气。

    #2:结对编程使入门更加出色

    由于在结对编程方法下知识传递是如此无缝,因此入职变得容易

    新员工不必参加长达数周的“训练营”或遵循过时的环境设置指南。

    新员工刚刚被分配了一对编程合作伙伴,就可以开始学习!

    在结对编程模型下,新员工有一个不变的角色模型可以工作。 他们将很快了解代码库,并开始更快地为公司创造价值。

    新员工经常在代码库的上下文中挣扎,而在编程知识方面则不然。 退伍军人在背景方面很扎实,但有时会尝试偷工减料,以更快地完成任务。

    这两个数字可以相互平衡。

    (应该说的是,新员工也常常想减少拐角。但是,退伍军人的道德标准更高,在新员工的观察下往往会更加努力)。

    无论哪种方式,新员工在工作的第一个月都比一文不值的糟糕。 他们从公司那里吸走价值,直到他们知道代码库的上下文。 在结对编程方法下,新员工有机会在第一天开始为公司创造价值。

    #3结对编程人员产生的代码多于两倍,个人和结对的代码对性格内向的人非常有用

    坦白地说,程序员在工作中花费的大部分时间实际上并不是在编写新代码。 它是调试战略测试等。

    如果每天计算机科学家的工作是写10,000个乱码,那么可以肯定的是,将两个不同的程序员放在不同的计算机上并让他们开始打字会更快。

    幸运的是,计算机科学并非如此。

    我们在 ,我们在键盘上花费的大部分时间都没有在打字。

    调试是一个指数浪费时间的事情。 如果团队中的某人知道错误的解决方案,则调试可能需要几秒钟。 如果团队中没有人知道该错误,则调试过程从几分钟几小时几天不等

    在一个工作站上有两个程序员,这意味着团队一旦遇到问题,知道如何解决问题的可能性就会增加两倍。 这也意味着程序员对寻求帮助负有更多责任。

    如果两个人必须互相征求意见,然后再寻求公司的另一对帮助,这意味着他们不会过分寻求帮助。 如果他们中的任何一个对如何进行操作都有想法,他们将尝试进行此操作,然后再调用备份。

    他们也不会寻求帮助。 当单个程序员忙于解决问题时,应该寻求帮助并不明显。 毕竟,它们可能只是一个顿悟之外的Google搜索。 但是,如果一 程序员在某个问题上陷入困境,那么显然他们应该寻求帮助。

    结对编程非常适合性格内向的人。 Menlo的程序员中有80%会自我识别为内向。 他们仍然喜欢结对编程方法。 为什么? 内向的人喜欢和他们在同一页面上的人。

    结对编程合作伙伴正在考虑相同的事物,检查相同的代码,并互相问相同的问题。

    这种血缘关系不仅健康。 好有趣。 面对棘手的程序性问题,不要孤单可以提高士气。

    也就是说,结对编程并不完美。

    缺点

    #1:结对编程会使简单的任务复杂化

    如果您有一个非常简单的错误修复程序或要实现的简单功能,那么让两名程序员来完成该任务可能会很昂贵。 另外,对于两个程序员而言,可能很难对花费最少的思想处理能力的任务保持兴趣。 如果您的环境具有大型测试套件或集成过程,那么结对编程会进一步增加资源消耗。

    我认为这是结对编程最费力的地方。 通过结对编程,简单的任务可能会变得过于复杂。

    它确实确实取决于那对。 有时,在完成简单任务时,拥有一对伴侣可以提高士气。

    #2:结对编程不能完全消除知识之塔

    许多结对编程作者都夸大了结对编程对知识塔的作用。 一些人认为结对编程是消除它们的“银弹”。 我同意配对对解决这个问题有很大帮助,但在业务上,我犹豫要不要说任何东西都是真正的“银弹”。

    在团队中,总会有人that积重要知识。 这不是恶意的,人们自然倾向于这个目标。

    结对编程并不能消除人的特质。 总是会有程序员找到垄断信息的方法。

    我仍然坚持认为,将知识塔与其他队友配对是一个比小人大做强的更好的解决方案,后者是解决此问题的另一种流行的方法

    罢免表现最好的员工可能是一个不错的短期解决方案,但从长远来看,这会阻碍员工尽力而为。

    虽然不能完全消除问题,但配对是解决知识塔难题的最佳长期解决方案。

    #3 Pair编程让员工承担超级责任,有时甚至过度负责

    在Menlo,许多员工说他们离开工作时感到“脑筋急转弯”。

    他们声称,他们在Menlo的思考比以往任何时候都要辛苦和更长的时间。

    这是因为当您有一对编程伙伴时,不可能懈怠。 拥有全天候在注视着您的队友,让您超级负责。 很难切角。 在工作中很难“调整”。

    这是好是坏。

    显然,专注于工作很重要。 但是,我认为精神休息和重新评估解决方案同样重要。

    因此,在Menlo,他们确保编程对全天都在休息。 早晨,Menlo员工进行一项名为“站立”的活动,他们在其中分享当天要从事的工作。 下午,他们进行了一项名为“ walkies”的活动,他们在街区周围行走。

    这些智力上的休息和活动对于成功的结对编程文化至关重要。

    如何在工作区中实现结对编程

    出售成对编程? 想试试看? 好吧,你很幸运。

    结对编程的好处在于,它不必是全有或全无的技术。

    在Menlo,他们做出了严格的业务决策,要求每个人都成对编码。 但这不是必须的。 如果您在一家更传统的公司工作,很可能会与一位同事结对来完成一项重要任务。

    如果您在敏捷开发模型下工作,另一个想法是与另一个程序员合作进行一次迭代。

    这些对策是在不花费太多资源的情况下进行配对编程试运行的好方法。 然后,您可以将这对货币对的有效性与公司的单个结果进行比较。

    如果您要尝试其中一种措施,建议您将复杂,关键任务和冗长的任务配对,而不是简单,不重要和简短的任务。 理由是前者可以带来长期的长期收益,并且可以最佳地展示结对编程。

    如果您确实要尝试配对编程,请在评论中让我知道它是如何实现的! 我很想听听这种令人振奋的新开发技术的成功(甚至失败)故事!

    TwitterInstagram上关注我,以随时了解我的内容!

    翻译自: https://hackernoon.com/the-ultimate-guide-to-pair-programming-b606625bc784

    结对编程

    展开全文
  • 结对编程Pair Programming — a pair that’s greater than the sum of its parts. You may have heard about pair programming and wondered whether it was worth trying in your workplace. On the surface it ...

    结对编程

    Pair Programming — a pair that’s greater than the sum of its parts. You may have heard about pair programming and wondered whether it was worth trying in your workplace. On the surface it sounds simple, but two developers sitting together are not all that it takes to achieve productive pairing.

    配对编程-一对大于其总和。 您可能听说过结对编程,并且想知道在工作场所是否值得尝试。 从表面上看,这听起来很简单,但是两个开发人员坐在一起并不是实现高效配对所需要的全部。

    Logistical and personal hurdles such as scheduling, tool choices, and distractions can stop you from getting the most out of pairing. But the potential advantages can make it worth the trouble of recognizing and surmounting these challenges.

    诸如计划,工具选择和分散注意力等后勤和个人障碍可能会使您无法充分利用配对。 但是潜在的优势可能使您值得去认识并克服这些挑战。

    为什么配对? (Why Pair?)

    How could it be more productive to take two programmers who were previously working on separate projects and have them work together on a single project? Won’t everything take twice as long? To an outsider the idea of pairing may sound counterproductive at first, but the advantages become apparent when you start to think about why we code and what we’re trying to accomplish.

    雇用两个以前在不同项目中工作的程序员,然后让他们在一个项目中一起工作,会更有效率吗? 不会花所有时间的两倍吗? 对于局外人来说,配对的想法乍看起来可能适得其反,但是当您开始思考我们为什么编写代码以及要完成的工作时,优势就变得显而易见。

    Programming is not about churning out the most lines of code in the shortest amount of time, or even delivering the most features within increasingly tight deadlines. You can have engineers working around the clock pushing new features into production, but how productive are they really if those features are cranked out by individuals working in isolation according to their own unique understanding of the overall architecture? The resulting code is likely to be riddled with technical debt such as hidden bugs, performance issues, idiosyncratic syntax, and inefficient designs that may not use resources efficiently and may make it that much more difficult and time consuming to modify the code when one of those flaws surfaces.

    编程并不是要在最短的时间内生产出最多的代码,甚至不是在越来越紧迫的期限内交付最多的功能。 您可以让工程师昼夜不停地将新功能投入生产,但是如果这些功能是由个人根据自己对整体体系结构的独特理解而单独开发出来的,那么它们真的有多大的生产力? 产生的代码可能会充满技术负担,例如隐藏的错误,性能问题,特质的语法以及效率低下的设计,这些设计可能无法有效利用资源,并且使修改代码变得更加困难和耗时,而其中之一是缺陷表面。

    You need your code to be meaningful and well written so that it works together seamlessly and can be modified easily. You need it to encapsulate the desired functionality so that your end product behaves properly and performs as expected. You need it to be resilient so it can withstand organizational changes that are a natural part of working together, as well as environmental changes and new customer expectations that may make today’s workable solution obsolete without much warning.

    您需要代码有意义并且编写得当,以便它们无缝地协同工作并且可以轻松地进行修改。 您需要它来封装所需的功能,以便最终产品正常运行并按预期运行。 您需要使它具有弹性,以便它可以承受自然而然地发生的组织变更,环境变更和新客户期望,这些可能会使当今可行的解决方案过时而又没有太多警告。

    In order to make that possible, developers need to be able to agree about fundamental requirements clearly, get up to speed quickly with whatever new or established technologies may be required, and focus without interruption to test out creative solutions and develop a product that’s worth putting in front of the customer.

    为了使之成为可能,开发人员需要能够清楚地同意基本要求,Swift掌握可能需要的任何新技术或既有技术,并专注于不间断地测试创意解决方案并开发值得投入的产品在客户面前。

    These are the real-world challenges that pair programming helps to address. When two developers work together in a pair, the quality of the code they produce improves along with their shared understanding of how it works. This makes it easier for the next person who reads the code to pick it up and modify it when necessary, and it reduces the danger that the only person on the team who knows how part of the code works may win the lottery and leave the team, taking that precious knowledge with them.

    这些是结对编程有助于解决的现实世界中的挑战。 当两个开发人员一起工作时,他们产生的代码质量以及对代码工作方式的共同理解将得到改善。 这使下一个阅读代码的人更容易在需要时进行拾取和修改,并且减少了团队中唯一知道部分代码工作原理的人可能中奖并离开团队的危险。与他们一起获得宝贵的知识。

    The time cost in mythical work hours is nowhere near the 50% that may seem intuitive if you tried to to equate the intricate art of coding with repetitive assembly line work. Some empirical studies have concluded that pair programming might result in about a 15% increase in the time it takes two programmers to accomplish the same tasks had they been working alone, but the resulting code will also be of much higher quality, with about 15% fewer observable defects to fix. Combine this with the shared ownership, deeper engagement, and faster problem solving that comes from having more than one mind engaged in solving a problem, and it’s clear why pair programming is a popular approach.

    如果您试图将复杂的编码艺术与重复的装配线工作等同起来,那么神话般的工作时间中的时间成本将远不及50%的直观成本。 一些经验研究得出的结论是,成对编程可能会使两个程序员(如果他们一个人工作)完成相同的任务所需的时间增加大约15%,但是结果代码的质量也要高得多,大约为15%更少的可观察到的缺陷可以解决。 结合使用共享所有权,更深入的参与和更快的问题解决能力,这要归功于一个以上的头脑来解决问题,这很清楚为什么配对编程是一种流行的方法。

    配对到底是什么? (What Exactly is Pairing?)

    So what does it take for two developers working together to achieve the productivity and quality improvements that come from pairing? It’s mostly a matter of learning how to work collaboratively, which is not necessarily the way most of us learned to code.

    那么,两个开发人员一起工作以实现配对带来的生产率和质量改善又需要什么呢? 这主要是学习如何协同工作的问题,这不一定是我们大多数人学习编码的方式。

    By definition, pair programming doesn’t start until you have two people working together on one computer. But how does that work in practice?

    根据定义,只有在两个人在一台计算机上一起工作时,配对编程才开始。 但是,这在实践中如何运作?

    两个人…… (Two People …)

    The fundamental element of pair programming is working together with your pair. When a task is accepted, it needs to be shared between both of the people working on it, and they both need to be fully engaged in the task while they’re pairing on it. That means that they both need to understand the requirements the same way, and work together to come to a shared understanding of how they want to go about meeting them.

    结对编程的基本要素是与您的结对一起工作。 接受任务后,需要在两个工作人员之间共享该任务,并且他们都需要在配对时充分参与该任务。 这意味着他们都需要以相同的方式理解需求,并共同努力以达成对如何满足这些需求的共识。

    Pairing helps people get better at verbalizing their ideas and expectations. The implicit understanding you have in your head when you’re working alone needs to be communicated so both you and your pair know you’re on the same page. Getting as explicit as possible about the work and the approach up front will help make the pairing experience much more agreeable. Pairing involves a lot of talking, as that’s the best way to keep two minds actively engaged in the problem at the same time.

    配对有助于人们更好地表达自己的想法和期望。 需要传达您独自工作时头脑中的隐含理解,以便您和您的伴侣都知道您在同一个页面上。 尽可能明确地了解工作和方法将有助于使配对体验更加令人满意。 配对涉及很多话题,因为这是让两个人同时积极参与问题的最佳方法。

    For this reason, pairing is often associated with agile story writing, in which requirements for a feature are defined in consistent, plain language that can be understood equally well by Product and Engineering people with little room for ambiguity. Often pairs will ask for stories to be spelled out in Gherkin, which is a way of using common, non-technical phrases that are easy to translate into automated tests, so the pair can verify and demonstrate that each feature works as expected.

    由于这个原因,配对通常与敏捷的故事写作相关联,在敏捷的故事写作中,功能要求以一致的普通语言定义,产品和工程人员可以毫不歧义地理解它们。 通常,两人会要求用Gherkin拼写故事,这是一种使用常见的非技术性短语的方式,这些短语很容易转化为自动化测试 ,因此,这对夫妇可以验证并证明每个功能都能按预期工作。

    Writing in Gherkin means taking a feature and breaking it down into a simple story about a customer who wants something that this feature will deliver:

    用Gherkin编写意味着将一项功能分解为一个简单的故事 ,该故事讲述了一个客户想要该功能将提供的功能:

    As <a customer of the product>
    I want <something desirable>
    So that <I can achieve a specific goal>

    Then all the acceptance criteria are written out in a consistent syntax, defining the anticipated permutations and scenarios associated with that story:

    然后,以一致的语法写出所有接受标准 ,定义与该故事相关的预期排列和方案:

    Given <a customer in a particular state>
    When <something specific happens>
    Then <there is a specific outcome>
    
    Given <a customer in a particular state>
    When <something different happens>
    Then <there is a different specific outcome>
    
    etc.

    Of course, it’s not mandatory to use this exact phrasing, but if the requirements of a feature can’t be expressed in this minimalist way, it’s possible that the expectations are ambiguous. That’s a potential red flag that’s easier for a pair of programmers to spot when they start to discuss what’s needed.

    当然,使用此精确措词不是强制性的,但是如果不能以这种最低限度的方式来表达功能的要求,则期望可能会模棱两可。 这是一个潜在的危险信号,当一对程序员开始讨论需要的东西时,他们很容易发现。

    As soon as a pair accepts a story to work on, they should be able to define how they will know they are done and how they’re going to prove it. From there, they can start to figure out together how best to approach the job.

    一旦一对人接受了一个故事,他们就应该能够定义他们将如何知道自己的完成以及如何证明这一点。 从那里,他们可以开始一起找出如何最好地完成工作。

    In fact, the pair working on a feature should know enough up front that they could start by writing an automated test based on the first acceptance criterion before writing any code, making sure the new test fails, and then writing just enough code to make that test pass before refactoring and then starting on the next acceptance criterion. This approach is known as behavior-driven development, and while it’s not part of the definition of pair programming, it harmonizes beautifully, along with test-driven development.

    实际上,从事某项功能的工作人员应该事先了解足够的知识,以使他们可以在编写任何代码之前先根据第一个接受标准编写一个自动化测试,以确保新测试失败,然后再编写足够的代码以使他们开始工作。在重构之前先测试通过,然后从下一个验收标准开始。 这种方法被称为行为驱动的开发 ,虽然它不是结对编程定义的一部分,但它与测试驱动的开发完美地融为一体

    合作 … (Working Together …)

    When you have two or more people trying to work together, the first thing they need to do is agree on a work schedule. It’s not really pairing if two developers aren’t working together at the same time. Because of this, it’s essential that the developers who plan to work together coordinate their schedules and make sure they both agree to a time and place where they will work.

    当您有两个或两个以上的人试图一起工作时,他们要做的第一件事就是在工作时间表上达成共识。 如果两个开发人员不能同时工作,那并不是真正的配对。 因此,计划一起工作的开发人员必须协调他们的日程安排,并确保他们双方都同意他们将工作的时间和地点,这一点至关重要。

    One mistake I’ve seen pairs make is trying to maximize the time they work together as a pair by scheduling a full eight hours together, and sometimes trying to work together beyond that. Pairing is intensive work that requires a heightened level of focus and participation. It’s very taxing to try to pair for more than five or six hours in a day, and even that might be stretching it for even the most resilient of us. When setting up a pairing schedule, try to agree on a fixed and limited time that will fit within a typical eight-hour work day, leaving time for lunch, email, personal tasks, etc. Those personal tasks are essential to our work day, but they’re also distractions that shouldn’t be attempted during a pairing session.

    我见过的一对人犯的一个错误是,试图通过安排整整八个小时的时间来最大化他们作为一对的工作时间,有时甚至尝试一起工作。 配对是一项繁重的工作,需要更高的关注度和参与度。 每天尝试配对超过五六个小时是非常麻烦的,即使对于我们最有弹性的人来说,这样做也可能会延长。 设定配对时间表时,请尝试约定一个固定且有限的时间,以适合典型的八小时工作日,留出时间吃午饭,电子邮件,个人任务等。这些个人任务对于我们的工作日至关重要,但它们也令人分心,在配对过程中不应该尝试。

    It can also be socially awkward to remind your pair when the agreed pairing time has come to an end. For that reason, it can be a good idea to set an alarm that will break the news to both of you without putting the burden on one or the other.

    当约定的配对时间结束时,提醒您的配对在社交上也很尴尬。 出于这个原因,最好设置一个警报,以在不增加彼此负担的情况下向您俩发布新闻。

    Skill level is another area where pairs can have trouble. It’s a fair assumption that, no matter what you’re working on, the person you’re working with has a different background, experience, and comfort with the topic. Recognizing that up front is important, so neither of you will feel the need to try to hide that fact. One of the benefits of pairing is that working together naturally brings up the skills of anyone learning something new, whether that something is a programming language or a communication style.

    技能水平是配对可能遇到麻烦的另一个领域。 一个公平的假设是,无论您从事什么工作,与您一起工作的人都有不同的背景,经验和对该主题的适应程度。 预先意识到这一点很重要,因此你们俩都不会觉得有必要隐瞒这一事实。 配对的好处之一是,自然地合作可以提高任何学习新知识的人的技能,无论这些知识是编程语言还是交流风格。

    Be gracious if you feel you’re more skilled than your pair. Treat them the way you’d want to be treated as you learned something new. And remember that the point is not only to get the work done, but to make sure that both of you have sufficient knowledge and ownership of the end result.

    如果您觉得自己比同龄人更熟练,请客气。 当您学到新东西时,以您希望的方式对待他们。 请记住,这不仅是要完成工作,而且是要确保你们俩都对最终结果有足够的知识和所有权。

    To that end, it’s vital that each programmer have the opportunity to sit at the keyboard and drive while the other observes and navigates through the code. The concept of taking turns may be new to anyone whose exclusive experience as a programmer has been solo work, so there will be a learning curve as you adapt to verbalizing your intentions when navigating, or carrying out someone else’s ideas when driving.

    为此,至关重要的是,每个程序员都有机会坐在键盘上驱动,而另一个则观察并浏览代码。 对于那些曾经独自从事过程序员的人来说,轮换的概念可能是陌生的,因此当您适应在导航时表达自己的意图,或者在开车时执行他人的想法时,学习弯道将是一个学习曲线。

    A programmer new to pairing but comfortable with the task at hand can easily get into a pattern of holding onto the driver role for as long as possible. Similarly, if you’re not driving at the keyboard and you’re not all that familiar with the code, it’s easy to find your mind wandering back to your phone, your email, and your other tasks. When that happens, you end up with one person coding alone and the other person sitting in the same room scrolling through social media.

    结对但对当前任务不熟悉的程序员可以轻松地尽可能长时间地担任驾驶员角色。 同样,如果您不使用键盘操作并且对代码不那么熟悉,那么很容易发现您的想法又回到了手机,电子邮件和其他任务上。 发生这种情况时,您最终将只有一个人独自编码,而另一个人坐在同一个房间中,通过社交媒体滚动。

    One of the clues that a pair might be having trouble taking turns is silence. Pairing is a noisy process, involving a lot of questions, feedback, discussion, and collaboration. When a pair finds themselves going for more than a minute or two without saying a word, it’s likely the pairing has stopped.

    一对人可能难以轮流的线索之一就是沉默。 配对是一个嘈杂的过程,涉及许多问题,反馈,讨论和协作。 当一对发现自己过去一两分钟没有说话时,很可能配对已经停止。

    One useful technique that can keep pairs from falling into this antipattern is to use a Pomodoro timer. These timers will keep a running countdown of the seconds as you work in 25-minute increments, and then tell you to take a break for five minutes. By switching roles between the driver and the navigator during these breaks, a pair can avoid lapsing into extended sessions with just one driver.

    一种可以防止线对陷入这种反模式的有用技术是使用Pomodoro计时器 。 当您以25分钟为增量工作时,这些计时器将使秒数连续倒计时,然后告诉您休息五分钟。 通过在这些休息时间期间在驱动程序和导航器之间切换角色,一对可以避免仅由一个驱动程序陷入扩展会话。

    在一台计算机上… (On One Computer …)

    Pairing only works when two people dedicate their full attention to a single computer. It’s better to avoid the distraction of having two (or more) active screens going during a pairing session. Even if one person just wants to look up some relevant code examples or check on the status of a background process, it’s better to do that on the one shared computer. If it’s a search, both developers can see how the search is constructed and what potential results come up. If it’s a status update, neither developer needs to be left behind.

    只有两个人全神贯注于一台计算机时,配对才有效。 最好避免在配对过程中让两个(或多个)活动屏幕分散注意力。 即使一个人只想查找一些相关的代码示例或检查后台进程的状态,也最好在一台共享计算机上执行此操作。 如果是搜索,那么两个开发人员都可以看到搜索的结构以及潜在的结果。 如果是状态更新,则无需任何开发人员。

    So in any pair, both developers must be able to see the screen they are working on together clearly. One of the essential tools for pairing is a monitor big enough that both developers can see what’s being written clearly. Depending on the circumstances, this can be accomplished with a shared laptop if you don’t mind huddling together and you use a large enough font with adequate contrast. A better solution is a larger desktop or wall-mounted monitor where the code can be displayed and viewed together more comfortably.

    因此,在任何一对中,两个开发人员都必须能够清楚地看到他们一起工作的屏幕。 配对的基本工具之一是监视器,监视器的大小足以让两个开发人员都能清楚地看到正在编写的内容。 根据情况,如果您不介意挤在一起,并且使用足够大且具有足够对比度的字体,则可以使用共享笔记本电脑完成此操作。 更好的解决方案是使用大型台式或壁挂式显示器,在其中可以更舒适地一起显示和查看代码。

    Remote pairing is a very viable option these days. There are a number of great solutions ranging from Slack or Zoom tools to full-blown integrated development environments and text processors that support screen sharing, conference calling, or both, allowing two people on opposite sides of the desk or opposite sides of the world to work together. Even if you’re at the next seat in an open office, screen sharing can make it easier for both of you to see and interact with the code on the screen more comfortably. (I just encourage you to stay focused and resist the urge to bring up your email in a separate window while you’re pairing remotely. It’s disrespectful, it will be obvious to the person you’re pairing with, and your distraction will make you miss out on opportunities to learn together and produce quality results.)

    如今,远程配对是一个非常可行的选择。 从SlackZoom工具到成熟的集成开发环境以及支持屏幕共享,电话会议或同时支持这两种功能的文本处理器 ,有许多种出色的解决方案,它们可以使两个人坐在办公桌的相对侧或世界的相对侧。一起工作。 即使您在开放式办公室的下一个座位上,屏幕共享也可以使您更轻松地在屏幕上查看代码并与之交互。 (我只是鼓励您保持专注,并避免在进行远程配对时在单独的窗口中显示电子邮件的冲动。这是不尊重他人的,对与之配对的人来说很明显,而分心会使您错失了共同学习并产生高质量成果的机会。)

    If a colocated pair is sharing a single machine, they’ll need to come to some agreements about the configuration of their shared computers, keyboards, mouses, etc. That ergonomic keyboard with all the custom hardware macros might not be the best choice for sharing. But if you don’t mind using the same laptop or keyboard and mouse, swapping roles from navigator to driver in a pair might be as simple as switching places.

    如果同一地点的一对共享一台计算机,则他们需要就共享计算机,键盘,鼠标等的配置达成一些协议。带有所有自定义硬件宏的符合人体工程学的键盘可能不是共享的最佳选择。 但是,如果您不介意使用同一台笔记本电脑或键盘和鼠标,则将导航器中的角色互换为驱动器中的角色可能就像切换位置一样简单。

    A popular and very robust solution is to make active use of a version control system like Git. Commit your code frequently to a shared repository so each developer can pull the latest version and work on their own device when they switch roles. Using version control to handle swapping in pairs has the added advantage of creating a more detailed history of code changes for future logging and potential rollbacks. If the Git logs get too cluttered, it’s always possible to go back and squash those extra commits into a single, more meaningful one before doing a pull request.

    一个流行且非常强大的解决方案是积极使用诸如Git之类的版本控制系统。 经常将您的代码提交到共享存储库,以便每个开发人员可以在切换角色时提取最新版本并在自己的设备上工作。 使用版本控制来成对处理交换具有额外的优势,即创建更详细的代码更改历史记录以用于将来的日志记录和潜在的回滚。 如果Git日志过于混乱,那么在执行拉取请求之前,总是有可能将这些多余的提交压缩成一个更有意义的单个提交。

    At a higher level, once you start pairing with another developer, you’re going to notice some differences in the ways you each approach your tasks. One of you might know some fancy keyboard shortcuts, have some special aliases for common shell commands, or prefer to use a specific IDE because of its unique features. In terms of the code itself, you may also each have a different implicit understanding about how variables are named, how to structure a commit message, when to use comments, etc.

    在更高的层次上,一旦开始与另一位开发人员配对,您将注意到每种处理任务的方式都有一些差异。 你们当中的一个可能知道一些精美的键盘快捷键,一些常见的Shell命令具有特殊的别名,或者由于其独特的功能而倾向于使用特定的IDE。 就代码本身而言,您可能还分别对变量如何命名,如何构造提交消息,何时使用注释等有不同的隐含理解。

    Pairing is an opportunity to make these unconscious variations in technique visible so everyone can benefit from the hidden wealth of experience and knowledge about how we code more effectively.

    配对是使这些无意识的技术变化可见的机会,因此每个人都可以从隐藏的丰富经验和知识中受益,这些经验和知识涉及我们如何更有效地编码。

    如何开始配对 (How to Start Pairing)

    There’s often a period of adjustment while building the muscle memory and learning to express ideas out loud that were once just thoughts in the back of your head. It’s also necessary to establish workable logistics to allow two people to work together, which might mean making adjustments in terms of schedules, locations, and equipment. And when you’ve got that working, you might try expanding the process to the whole team with enhancements such as mob programing for groups, or promiscuous pairing to give everyone on the team a chance to pair on all of the team’s stories.

    在建立肌肉记忆力并学会大声表达曾经只是想法的想法时,通常需要一段时间的调整。 建立可行的物流体系以使两个人一起工作也很有必要,这可能意味着要在时间表,位置和设备方面进行调整。 并且,当您完成工作后,您可以尝试通过增强功能(例如为小组进行暴民编程混杂配对)将流程扩展到整个团队,从而使团队中的每个人都有机会结识团队中的所有故事。

    Putting in the effort to get through the learning stages usually pays off in significant improvements, both for the quality of the code and for the happiness and sustainability of the people who create it. And if your entire team or organization adopts pairing, the learning curve will become even easier for new people, improving the onboarding process and helping everyone be more productive.

    付出努力来学习阶段通常会带来重大的改进,无论是代码的质量还是代码编写者的幸福感和可持续性。 而且,如果您的整个团队或组织采用配对,那么新人的学习曲线将变得更加轻松,从而改善了入职流程并帮助每个人提高了工作效率。

    翻译自: https://www.sitepoint.com/pair-programming-guide/

    结对编程

    展开全文
  • 在开发软件项目时,不仅写出相应功能的模块很重要;确保写出的模块的易维护性(bug 修复,代码重构)也同样重要。 主打互联网技术和门户...为了避免这种情况发生,他们决定在开发复杂模块时试验性地使用结对编程
  • 结对编程Some companies prefer to pair program with candidates to get a feel for working with them while gauging their skills. I have been in a couple of those companies, and more often than not, one ...

    结对编程

    Some companies prefer to pair program with candidates to get a feel for working with them while gauging their skills. I have been in a couple of those companies, and more often than not, one of my tasks was to be the pair in those interviews.

    一些公司更喜欢将程序与候选人配对,以在评估其技能的同时获得与他们合作的感觉。 我曾在其中一些公司工作过,而且我经常要做的一个任务就是成为这些访谈中的一对。

    In my previous job with a consulting company, we had teams for each project. Some projects had NDAs, and as such, anyone joining that team had to sign in. This led to difficulties in using those codebases when pairing with potential employees. As a result, we mostly paired on either internal projects or on projects where the client was okay with showing code to candidates.

    在我之前在一家咨询公司的工作中,每个项目都有团队。 有些项目具有NDA ,因此,加入该团队的任何人都必须登录。这导致在与潜在员工配对时使用这些代码库很困难。 结果,我们大多与内部项目或客户可以向应聘者显示代码的项目配对。

    I was usually on the teams with no NDAs, so whenever we had candidates, I was the main pair. Being in that company for five years, you can only imagine how many candidates there were. There were times when, during my work week, I was pairing with a different person each day!

    我通常是没有NDA的团队,所以只要有候选人,我就是主要的一对。 在那家公司工作了五年,您只能想象有多少候选人。 有时候,在我的工作周中,我每天都与另一个人配对!

    We also do pair programming in my current company. Since I have been practicing pair programming since 2010, it has become natural to me.

    我们还在我目前的公司中进行配对编程。 自2010年以来我一直从事结对编程工作,这对我来说已经很自然了。

    But the one thing to remember about these interviews is that it goes both ways: the interviewer learns about the interviewee’s skills and personality, while the interviewee learns about whom they will be working with and what a typical work day looks like.

    但是,有关这些面试的一件事情要记住,它是双向的 :面试官了解被访者的技能和性格,而面试官则了解他们将与谁一起工作以及典型的工作日。

    So here are the lessons I learned from pair programming interviews, both as the interviewee and interviewer. Hopefully this will help you have a better idea for your next interview.

    因此,这是我从结对编程面试中(作为受访者和面试官)学到的课程。 希望这可以帮助您对下一次面试有一个更好的主意。

    做好准备 (Be prepared)

    If there’s one thing that you can take away from this, please let it be this one. It may seem obvious that, as in any interview, you HAVE to be prepared — but I just felt that I needed to emphasize this point.

    如果您可以从中拿走一件事,请让它成为这一件事。 这似乎是显而易见的是,在任何面试中,你必须做好准备-但我只是觉得我需要强调这一点。

    As an interviewer, look through your candidate’s CV, résumé, or source code if they have submitted it. This will help you set your own expectations for their skill level and personality, which will help when communicating with them. Knowing that you have the same hobbies could be a good ice breaker!

    作为面试官 ,请查看候选人的简历,简历或源代码(如果已提交)。 这将帮助您对他们的技能水平和个性设定自己的期望,这将在与他们交流时有所帮助。 知道自己有相同的爱好可能是一个很好的破冰者!

    As an interviewee, go to the company’s website and read / click through. I have been in a situation where I applied as a web developer, and the first question thrown at me was, “So, have you seen our website? What do you think can you do to improve it?” Suffice it to say, I botched that interview. So please, at the very least, have a look at their website. Review your code if you submitted it and double check everything.

    作为受访者 ,请访问公司的网站并阅读/单击。 我曾经申请过Web开发人员,当时遇到的第一个问题是:“那么,您看过我们的网站了吗? 您认为您可以采取什么措施来改善它?” 可以说,我把这次采访弄糟了。 因此,至少,请访问他们的网站。 查看您提交的代码,并仔细检查所有内容。

    放松,做自己。 (Relax and be yourself.)

    This may sound like generic advice, but it is much more important for a pair programming session compared to a general or technical interview. Why? Simply because, in some general interviews, an HR person talks to you and gauges your personality for the duration. While you would be in the same company as they are, you won’t be directly working with them every day.

    这听起来像是一般性建议,但与一般或技术面试相比,这对结对编程会话更重要。 为什么? 仅仅是因为,在一些一般性采访中,人力资源人员会与您交谈并评估您的个性。 尽管您将与他们同在一家公司,但您不会每天都直接与他们合作。

    In a pair programming session, if the company does pair programming most of the time anyway, you would likely be working closely with your interviewer as part of your job. That is the main difference.

    在结对编程会议中,如果公司无论如何大部分时间都进行结对编程,则作为工作的一部分,您可能会与面试官紧密合作。 那是主要的区别。

    This works for both the interviewer and interviewee. Like in any relationship, it’s hard to have a long term relationship if you build it based on only part of the picture. Your foundation will be a shaky ground of uncertainty, and sooner or later it will come out and might result in some problems.

    这适用于面试官和受访者。 像在任何关系中一样,如果仅基于图片的一部分来建立长期关系,则很难保持长期关系。 您的基础将是不确定性的不稳定基础,迟早它会出来并可能导致一些问题。

    问问题! (Ask questions!)

    As an interviewer, be aware that most of the time the candidate will be nervous. While asking too many questions can potentially scare them away, not asking any questions puts you in the dark and wastes your day of pairing.

    作为面试官 ,请注意,大多数时候候选人会感到紧张。 提出过多的问题可能会吓跑他们,但不提出任何问题会让您陷入困境,浪费您的配对时间。

    I’ve learned to list down a set of questions that I get to ask during the day of pairing. The list does not have to be in order, and you do not have to ask them all in one go. Most of the questions will come up while you are pairing, but it’s best to have them written down just in case.

    我学会了列出配对当天要问的一系列问题。 列表不一定是按顺序排列的,您不必一口气问他们。 配对时,大多数问题都会出现,但是最好记下它们,以防万一。

    As an interviewee, remember that some interviewers EXPECT you to ask questions. Not asking means you are not interested (why are you applying anyway?) or you know everything (which you don’t).

    作为受访者 ,请记住,有些采访者期望您提出问题。 不询问就意味着您不感兴趣(无论为什么要申请?),或者您知道一切(不知道)。

    Whenever I pair with someone, I take note of when they ask a question and how often. Questions can range from simple syntax questions like “What was the first argument for each_with_index again?” to work-related questions like “Do you usually pair every day?”

    每当我与某人结伴时,我都会记下他们何时提出问题,以及发出询问的频率。 问题的范围从简单的语法问题开始,例如“再次为each_with_index的第一个参数是each_with_index ?” 处理与工作相关的问题,例如“您通常每天配对吗?”

    没有对与错的解决方案 (There are no right or wrong solutions)

    For me, it’s just a matter of getting the job done. While I expect candidates to be at their best, I do understand that they will be nervous which might slightly affect their thinking.

    对我来说,这只是完成工作的问题。 虽然我希望候选人能做到最好,但我确实知道他们会紧张,这可能会稍微影响他们的思维。

    I mean, having mental blocks during an interview is pretty common (at least for me). I’ve paired with a range of people from new grads, to juniors, mid-level developers and even seniors, and I myself sometimes black out.

    我的意思是,在面试中出现精神障碍非常普遍(至少对我而言)。 我结识了许多人,从新应届毕业生到初级,中级开发人员,甚至是高年级学生,我本人有时都会感到沮丧。

    Case in point: when I was being interviewed for my current job (I already had more than six years of Ruby experience at that point), I was chugging along with a simple exercise and I totally forgot how to create a Hash. Like, I just went, “Um. Wait how do I do that again? Um, can I Google something?” Pretty embarrassing, but when I asked, my pair also just blanked out so we both Googled it together. Fun times.

    恰当的例子:当我正在接受我目前的工作面试时(当时我已经有超过6年的Ruby经验),我在进行简单的练习的同时一直在苦苦挣扎,却完全忘记了如何创建Hash 。 就像,我刚刚去,“嗯。 等待,我该怎么做? 嗯,我可以用Google吗?” 真令人尴尬,但是当我问到时,我的那对也就空白了,所以我们一起用Google搜索了它。 娱乐时间。

    As an interviewer, don’t be stuck to the notion of your own solution to a problem. There are 11287398173 ways to write FizzBuzz and your solution is (probably) not the best one there is. Instead, be more open to other solutions and judge them as best you can.

    作为面试官 ,不要固守自己解决问题的想法。 有11287398173种编写FizzBu​​zz的方法,您的解决方案(可能)不是最好的。 相反,请对其他解决方案更加开放,并尽其所能对其进行判断。

    When I do pairing interviews, I usually have an answer in mind when I ask a question, but I listen and see what the interviewee’s answer is, because it is almost never the same answer as mine. You’ll be surprised at how creative people can get!

    配对采访时,通常我会在问一个问题时牢记一个答案,但是我会聆听并看到受访者的答案是什么,因为它几乎与我的答案不同。 您会惊讶于富有创造力的人如何获得!

    As an interviewee, be aware of this fact and just do your thing. Don’t get stuck worrying that you won’t be efficient (unless that was the interview question!) but at the same time, don’t be sloppy. If you come in to a pairing session for a company that does TDD/BDD, for your sake, start with tests first! They will be looking for that (I do!) and you could end up at the bottom of the pile if you just smash things out.

    作为受访者 ,请注意这一事实,然后做您自己的事情。 不必担心担心自己效率不高(除非这是面试问题!),但同时不要马虎。 如果您参加为TDD / BDD进行服务的公司的配对会议,请先进行测试! 他们会寻找的(我愿意!),如果您只是砸东西,您可能会陷入困境。

    将此视为正常的配对日 (Treat this as a normal pairing day)

    Based on my initial experience, I treated it as a technical interview. I sat beside the candidate and took notes while they typed out their thoughts.

    根据我的初步经验,我将其视为技术面试。 我坐在候选人旁边,记下他们的想法时做笔记。

    But this is NOT how I usually pair, and when I realized that, I changed my ways. When someone was stuck, I would nudge them along without exactly giving the answer. I’d ask some probing questions like “What is the error message?” or “What do you think is the problem?” or “What could you do to fix it?”

    但这不是我通常配对的方式,当我意识到这一点时,我改变了自己的方式。 当有人被卡住时,我会轻推他们,而没有给出确切答案。 我会问一些探索性问题,例如“什么是错误消息?” 或“您认为问题出在哪里?” 或“您该怎么做才能解决?”

    As an interviewer, let your candidate drive 90% of the time — but never 100%. That gives off the impression that it is a stricter tech interview (you’re just beside them looking at their every move — which actually makes concentrating harder). Have a go with the keyboard a bit and let them talk you through their solution. This will put them at ease.

    作为面试官 ,让您的候选人有90%的时间开车-但绝对不要100%。 这给人的印象是,这是一次更严格的技术面试(您就在他们旁边,看着他们的一举一动,这实际上使专心致志)。 稍微使用一下键盘,让他们通过解决方案与您交谈。 这会让他们放心。

    As an interviewee, don’t just start typing the moment the keyboard is given to you. Start discussing your solution first. Ask your partner if they want to have the keyboard while you let them know your thoughts. Remind yourself that this is more of a pairing “test drive” instead of a tech interview. Which brings me to the next point …

    作为受访者 ,不要只是在给您键盘后立即开始输入。 首先开始讨论您的解决方案。 在让他们知道您的想法的同时,询问您的伴侣是否想要键盘。 提醒自己,这更像是一对“试驾”,而不是技术面试。 这把我带到了下一点……

    跟你伙伴聊聊 (Talk to your partner)

    This is the first thing I check when I do pairing interviews. In my previous company, I usually started the day by explaining what the app we’re working on does, what the feature I am working on is, and what we’re supposed to do. I then started typing out my specs and let the candidate have the reigns.

    这是我进行配对采访时要检查的第一件事。 在我以前的公司中,我通常以解释我们正在使用的应用程序的功能,正在使用的功能是什么以及我们应该做什么的开始。 然后,我开始输入我的规格,让候选人掌权。

    I would pay attention to see what they did: sometimes they just went ahead and started typing, others they would think silently first, and still others would straight up ask questions about the problem or let me know their solutions.

    我会注意他们所做的事情:有时他们只是继续打字并开始打字,其他人他们会首先默默思考,还有一些人会直截了当地问问题或让我知道他们的解决方案。

    In my current company, the pair session usually focuses on a given problem. I give the candidate the problem to read and then I wait. If they start typing without saying anything, that is already a red flag for me. I give points to people who get a pen and paper and start explaining their solution to me with diagrams.

    在我目前的公司中,结对课程通常专注于特定问题。 我给应试者阅读的问题,然后我等待。 如果他们不说什么就开始打字,那对我来说已经是一个危险信号。 我给那些拿笔和纸并开始用图表向我解释他们的解决方案的人打分。

    As an interviewer, it is important to keep the conversation going to let the candidate feel that it is a pairing session. At this point in time, you two are a single unit. You should both be able to communicate well with each other and bounce ideas back and forth.

    作为面试官 ,重要的是要保持对话,以使应聘者感到这是配对会议。 此时,您两个是一个单元。 你们俩都应该能够很好地相互交流,并能反复交流想法。

    Of course, there will be times your candidate will need to think by themselves, so let them have that as well. Find the balance between keeping up the conversation and letting them focus and solve the problem.

    当然,有时候您的候选人将需要自己思考,所以也让他们自己考虑。 在保持对话与让他们集中精力解决问题之间找到平衡。

    As an interviewee, always let your partner know what you plan to do and what your solution is. This lets them know that you recognize the fact that this is a pairing session and that you can communicate your ideas well. This also gives them the feeling that you plan things carefully, instead of going YOLO.

    作为受访者 ,请始终让您的伴侣知道您打算做什么以及解决方案是什么。 这使他们知道您已经认识到这是配对会议,并且可以很好地交流想法。 这也给他们一种感觉,您可以仔细地计划事情,而不是去YOLO

    花一点时间思考是可以的 (It’s okay to take a moment to think)

    In contrast to the above statement, you also should be able to have the time to think silently. It is absolutely okay to have dead air. You are not in a radio station after all.

    与上述陈述相反,您还应该有时间静默思考。 死气绝对可以。 毕竟您不在广播电台中。

    As an interviewer, you will rarely have to do this. But if you are in my situation, where you are pairing with a candidate on a feature you’re actually implementing, then you too will need time to think. Just let your partner know about this and it should be fine.

    作为面试官,您几乎不必这样做。 但是,如果您处于我的情况下,正在与您正在实际实现的功能上的候选对象配对,那么您也将需要时间进行思考。 只要让您的伴侣知道这一点,就可以了。

    As an interviewee, you can let your partner know that you will need a bit of time to think and that you will let them know your solution after. This shows that you are acknowledging their presence and that you will be communicating your thoughts after you process them. Communication is key!

    作为受访者 ,您可以让您的伴侣知道您将需要一点时间来思考,之后您将让他们知道您的解决方案。 这表明您正在确认他们的存在,并且在您处理他们的想法后将进行交流。 沟通是关键!

    最后的想法 (Final thoughts)

    These are just some things I learned. Hopefully they can help you in your next interview. While this is not a comprehensive list about how to ace a pairing interview, I think that it can help candidates (and first time interviewers as well!) in their interviews.

    这些只是我学到的东西。 希望他们能在您的下一次面试中为您提供帮助。 虽然这不是有关如何进行配对面试的完整列表,但我认为它可以帮助候选人(以及首次面试官!)进行面试。

    Good luck! And also remember that no matter what happens, you will come out of that interview having learned something — and that is what matters.

    祝好运! 还要记住,无论发生什么事情,您都会从面试中学到一些东西,而那才是最重要的。

    翻译自: https://www.freecodecamp.org/news/things-ive-learned-from-pair-programming-interviews-35a4db7d7443/

    结对编程

    展开全文
  • 结对编程是构建软件系统的一种有效方法。采用结对编程,带来的显著效益:更好的想法——持续不断的头脑风暴、更大的知识库、在理解上有更少的差异、有更多的脑力解决设计问题;  结对编程是构建软件系统的一种有效...
  • 项目总结之结对编程

    2021-02-27 08:09:46
    在项目中,我们实行了结对编程,获得了一定...结对编程,在每一时刻都是一个程序员在编程,说效率如何高,也只是1+1>1,但是否大于2呢?答案是肯定的。首先,一个人的编程,平均很难实现1>80%×1的工作效力。但是在和同
  • 结对编程 默认情况下,我们总是成对进行工作。 我们坚信,由两个人完成同一任务所获得的质量要优于由一个人完成的质量。 但是,有时配对不是很有效。 配对编程陷阱 在专业环境中,与具有不同软件开发基础的开发...

    结对编程

    默认情况下,我们总是成对进行工作。 我们坚信,由两个人完成同一任务所获得的质量要优于由一个人完成的质量。 但是,有时配对不是很有效。

    配对编程陷阱

    在专业环境中,与具有不同软件开发基础的开发人员结对可能会很慢,很累而且很沮丧。 让我们探讨一些配对编程的陷阱。

    结对编程可能很慢且令人沮丧

    木偶对编程 必须对每个变量名称进行解释并达成共识可能会非常烦人。 讨论设计决策时,情况会变得更糟。 辩论可能持续数分钟,甚至数小时。 挫败感开始了。配对时,我们经历了多少次:“哦,拜托。 您怎么能不同意呢? 这是常识。 我们可以停止辩论,只完成血腥的故事吗?” 这些年来,我开始了解到不存在常识。 当人们用完论据时,这只是一个短语。

    如何改进它:当开发人员不需要讨论诸如方法大小,单一职责原理,如何命名变量以及一些基本软件设计原理之类的基本概念时,结对编程将变得更加高效和愉悦。 当开发人员具有类似的基础时,他们可以纯粹专注于找到解决问题的更好方法,而不必浪费时间进行不必要的讨论。 使整个团队达到相同理解水平的一种方法是组织定期的技术会议(动手实践,读书会,圆桌讨论等),定义团队标准,回顾和代码审查。

    结对编程可能很累

    花一整天与某人配对可能会很累。 我们需要在每一行代码上证明并达成共识。 对于一个开发人员来说琐碎的事情可能对另一个开发人员而言并不琐碎。 随着eXtreme编程的普及,某些公司开始要求成对编程。 要求开发人员在同一时间到达,在同一时间休息午餐,然后在同一时间离开,因为他们需要全天候配对。 归根结底,开发人员精疲力尽,因为他们没有时间陪伴自己。

    如何改进:开发人员需要一些时间。 定期休息很重要。 使用Pomodoro技术是强制定期休息的好方法。 以下是更多提示。

    结对编程可以扼杀创造力

    我们的一位客户最近问我,他们的UX和UI团队是否也应该成对进行工作。 总的来说,我认为这是个好主意,但是有时候您需要空间来进行创新。 有时您想探索一些半生半熟的想法,但尚无法将它们说成语言。 软件设计也是如此。 有时,我们需要一些单独的时间来创建。 在您受到时间或坐在您旁边的人等着您的压力的环境中,很少有创造力和创新等待您解释您打算做什么。

    如何改进它:任何团队成员都可以表达自己独自完成一项任务的愿望。 这并不意味着其他团队成员将不会审查她的工作。 在短时间独自工作之后,此人可以向团队其他成员展示她的想法,并选择一对来完善和完成工作。

    没有经验的开发人员并不总是从配对中受益

    结对编程是指导经验不足的开发人员的好方法。 但是,它不可能100%地发生。 他们在对我们的学徒讲话时说,尽管有人专职他们真是太好了,但他们还需要一些时间独自进行研究和犯错。 开发人员通过这样做来学习,他们需要一些空间以自己的速度来做事情。 我们的学徒认为,尽管他们向我们的工匠学习了很多东西,但他们并没有吸收所有东西。

    将经验丰富的开发人员与经验不足的开发人员配对是一种让经验不足的开发人员了解事物运作方式的好方法。 但是,这样做的副作用并不总是积极的:没有经验的开发人员最终没有花费足够的时间进行研究,尝试和犯错。 经验不足的开发人员可能会学习经验丰富的开发人员如何做事,但她无法完全理解原因。

    如何改进它:指导缺乏经验的开发人员的更好方法是成对地开始一项任务,给出一些高级指导,然后让缺乏经验的开发人员自己完成任务。 如果遇到困难,可以随时寻求帮助。 完成后,经验丰富的开发人员应审查她的工作。 在这一点上,如果提出改进建议,则两个开发人员都可以比较不同的方法。

    一般准则

    像足球队一样,开发人员应该具有相同的目标并与团队合作。 但是,我们还需要为个人创造力提供空间。 最好的足球队之所以赢得比赛,不仅是因为他们出色的团队合作,还因为他们的个人才能。 一个单独的游戏可以改变整个游戏。

    有些人早上工作得更好。 其他人,例如我,在晚上工作得更好。 但是重要的是,有一段时间让整个团队在一起,成对工作。 最近,我们作为团队同意将我们的“配对时间”从上午10点至下午5点。 这样,人们可以在清晨或午后独处。

    默认情况下,我们更喜欢成对工作。 我们对结对编程的好处毫无疑问。 但是,我们也认为为个人创造力和学习提供空间是必不可少的。

    翻译自: https://www.javacodegeeks.com/2015/03/rethinking-pair-programming.html

    结对编程

    展开全文
  • 结对编程

    2019-04-25 12:55:45
    作业说明 代码地址(main.cpp):https://dev.tencent.com/u/dtid_8e46ef0cf41e34d6/p/ruanjiangongcheng/git/tree/master 审查表 是 功能模块名称 实现C语言集程序的词法分析 ... ...
  • 如果你没有尝试过,那你更应该读下去,因为这篇文章将会带你体会这种编程模式,带你走进结对编程的世界。这次结对项目的名称为“学术会议的展示”,即在原有的微软学术地图的基础上,添加学术会议的信息及地理位置...
  • Pivotal公司的Edward Hieatt和他的同事都是从事敏捷开发培训,指导结对编程工作,在跟客户合作中,他们发现有大量的创业公司在成长壮大的过程中,都会经历不同程度的企业开发文化上的变质侵蚀。跟Pivotal公司合作过...
  • (1)首先应该是结对编程的高效率了,结对编程的时候,两个人可以分开做不同的unit,也可以同时做相同的unit。在项目的一些简单的unit,一个人能够很简单的unit就可以分给不同的人去做;对于核心的unit,比如说此次...
  • 什么是结对编程

    千次阅读 2019-10-05 21:05:15
    结对编程(英语:Pair programming)是一种敏捷软件开发的方法,两个程序员在一个计算机上共同工作。一个人输入代码,而另一个人审查他输入的每一行代码。输入代码的人称作驾驶员,审查代码的人称作观察员(或导航员...
  • 结对编程作业1

    2019-09-25 08:16:37
    1.链接 学号:201521123069 博客链接:http://www.cnblogs.com/kzq-java-markdown/ 学号:201521123074 博客链接:...结对编程码云项目链接:https://gitee.com/guzhiling/software_engineering/tree/master...
  • 结对编程是什么? 在此模式下,一对程序员并肩作战,平等互补进行开发工作。两个程序员并排坐在一台电脑前,同对一台显示器,使用同一个键盘,同一个鼠标进行工作。一起分析,一起测试,一起设计,一起编程。 这个...
  • 通过对实际软件开发过程的观察,从设计人员的角度说明结对编程是一种有效地改善沟通、提高技术技能的方法。结对编程是极限编程的十二个实践之一,是团队设计的基础。结合实际项目提出在不同开发阶段分别使用设计结对...
  • ThoughtWorks 结对编程

    千次阅读 2017-06-04 21:51:36
    可能就是某个懒散的下午,打开电脑,不知道做什么,打开牛客看了看,随即看到结对编程,不知道是做什么的,点开看了看;页面很好,不想中国人写的; 鬼使神差的就报名了,点进去看了看,居然 还有题;而且第一道题...
  • Pivotal公司的EdwardHieatt和他的同事都是从事敏捷开发培训,指导结对编程工作,在跟客户合作中,他们发现有大量的创业公司在成长壮大的过程中,都会经历不同程度的企业开发文化上的变质侵蚀。跟Pivotal公司合作过的...
  • 结对编程I’ve recently changed my thinking around “programming dogmas” — the things we do because we believe they’re best practice — because we’ve been told they are, even when our own ...
  • 结对编程总结

    2018-10-08 23:08:00
    一、结对编程的优点和缺点 优点: 关于结对编程,我发现了一些新的受益之处。首先,它可以促进参与项目的程序员自身的提高,一对程序员工作的时候,水平较低的一方会潜移默化地受水平略高的程序员影响,学到一些...
  • 结对编程by Marcus Gardiner 通过马库斯·加德纳(Marcus Gardiner) 想成为一名开发人员? 您可能应该是结对编程。 (Want to be a developer? You should probably be Pair Programming.) When people think of ...
  • 即时结对编程,只需添加网络! PairJS 基本上是一个增压的实时协作编辑,相当于python -m SimpleHTTPServer 。 您选择一个目录,它不仅可以将静态文件作为 Web 服务器提供服务,还可以让您和您网络上的任何其他人...
  • (1)此次结对编程项目不仅让我对Java语言掌握得更加熟练,更让我对Swing编程有了更深一步的了解,如何对界面、按钮进行美化,如何让页面之间衔接得更加流畅,如何巧妙地利用标签来提示用户信息,让他们在合适的时机...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 23,434
精华内容 9,373
关键字:

结对编程