结对编程_想成为一名开发人员? 您可能应该是结对编程。

结对编程

by Marcus Gardiner

通过马库斯·加德纳(Marcus Gardiner)

想成为一名开发人员? 您可能应该是结对编程。 (Want to be a developer? You should probably be Pair Programming.)

When people think of software development, they understandably think of a lone wolf programmer shut off from the world, solving complex problems.

人们想到软件开发时,可以理解的是,一个孤独的狼程序员与世隔绝,解决了复杂的问题。

What if I told you this was hardly ever how software development truly works in the real world…and that pair programming could be your answer to learning to code faster, preparing yourself for the real world of software development, and maybe having more fun in the process?

如果我告诉你这几乎是软件开发在现实世界中真正工作的方式……那对编程可能是您更快地学习编码,为软件开发的现实世界做准备,以及可能在其中获得更多乐趣的答案。处理?

听起来不错。 那么软件开发人员如何真正工作? (Sounds good. So how do software developers really work?)

What may be more accurate is a team of software developers, shutting themselves off from the world sometimes, connecting themselves to the world at other times, and still solving complex problems (but together).

也许更准确的是一个软件开发人员团队 ,有时将自己与世界隔离开来,在其他时间将自己与世界联系起来,并且仍然解决复杂的问题(但在一起 )。

The lone-wolf scenario may be true in certain situations, such as completing a side project or freelance work. More often than not, however, software development for products of any meaningful scale is done by a fully-fledged software team, likely with a mix of different development strengths (see below image from the DSDM Agile Framework). This software team will be plugged into a broader business and commercial team (we can’t forget our end user :) )

独狼方案在某些情况下可能是正确的,例如完成辅助项目或自由职业者。 然而,通常情况下,任何规模的产品的软件开发都是由成熟的软件团队完成的,并且可能具有不同的开发优势(请参见下图DSDM Agile Framework)。 该软件团队将加入到更广泛的商业和商业团队中(我们不会忘记最终用户:))

What does this mean for us software developers that are learning the trade? It means that while learning to code often starts as a lone wolf game, we want it to (as soon as possible) grow into the team sport of software development that is prevalent in most organizations.

这对我们学习该行业的软件开发人员意味着什么? 这意味着尽管学习编码通常是从一个孤独的游戏开始的,但我们希望它(尽快)发展成为大多数组织中普遍存在的软件开发团队运动。

Beyond the coding content itself, it is essential to building the collaboration and team-working skills that will help you thrive in a software development team. Having external support from others to stretch you is also a fantastic (maybe the best) way to learn, even if the natural temptation is to battle through tricky coding problems alone.

除了编码内容本身之外,建立协作和团队合作技能也至关重要,这将有助于您在软件开发团队中蓬勃发展。 即使别人的自然诱惑是要独自克服棘手的编码问题,也需要别人的外部支持来扩展您的学习也是一种绝妙的(也许是最好的)学习方法。

Finding a team to learn and grow with may not be a practical solution. Finding one other person to pair program with is a much more realistic starting point.

寻找一个学习和成长的团队可能不是一个可行的解决方案。 寻找另一个与程序配对的人是一个更现实的起点。

好吧,我很感兴趣 (Ok, I am intrigued…)

对于初学者:什么是结对编程? (For the uninitiated: what is pair programming?)

Thankfully, Wikipedia can help us here:

幸运的是,维基百科可以在这里帮助我们:

“Pair programming is an agile software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two programmers switch roles frequently.”

对编程是一种敏捷的软件开发技术,其中两个程序员在一个工作站上一起工作。 一个是驱动程序 ,负责编写代码,另一个是观察员导航员 ,负责在键入每一行代码时对其进行检查。两个程序员经常切换角色。

How does this change the mindsets of the two people approaching the code?

这如何改变两个人接近代码的观念?

“While reviewing, the observer also considers the “strategic” direction of the work, coming up with ideas for improvements and likely future problems to address. This frees the driver to focus all of their attention on the “tactical” aspects of completing the current task, using the observer as a safety net and guide.”
“在进行审查的同时,观察员还考虑了工作的“战略”方向,提出了改进意见和可能解决的未来问题。 这样,驾驶员就可以将观察者用作安全网和指南,从而将精力集中在完成当前任务的“战术”方面。”
嗯不错。 但是这对编程不是很不舒服吗? (Ok cool. But isn’t this pair programming thing going to be highly uncomfortable?)

You may be skeptical of pair programming — I certainly was skeptical myself. Your first thoughts may be that the idea sounds like an uncomfortable one. Will it be like this?

您可能对结对编程持怀疑态度–我当然对自己也持怀疑态度。 您的第一个想法可能是这个想法听起来很不舒服。 会这样吗?

To soothe your reasonable skepticism, let’s talk about some of the advantages of pair programming, applied with a particular focus on those near the start of their coding journey.

为了缓解您的合理怀疑态度,让我们谈谈结对编程的一些优点,这些优点尤其适用于那些即将开始编码之旅的人。

结对编程的三大核心优势是为正在学习编码的人量身定制的: (Three core advantages of pair programming, tailored to someone who is learning to code:)

(1)结对编程是一种向其他编码器学习的绝妙方式。 ((1) Pair programming is a fantastic way to learn from another coder.)

In no other environment will you be on the same exact point of a coding challenge, struggling through the exact same problem, and trying to solve it together. You will laugh, you will cry, and you will ultimately learn.

在任何其他环境中,您都不会面临完全相同的编码挑战,要努力解决完全相同的问题,然后尝试共同解决问题。 你会笑,你会哭,你最终会学习

Importantly, you will have accrued different knowledge bases as you have learned to code, and you’ll be able to pick up new content from your pair. More importantly, good programming is ultimately about applying your best problem-solving process, not just having lots of content knowledge (see this post). Pair programming will enable you to learn from another developer’s process, as well as give you an opportunity to receive feedback on your own coding process (more on feedback below).

重要的是,当您学习编码时,您将获得不同的知识库,并且您将能够从他们的对中获取新内容。 更重要的是,好的编程最终是要应用最佳的解决问题的过程,而不仅仅是拥有大量的内容知识( 请参阅此文章 )。 结对编程将使您能够从其他开发人员的过程中学习,并有机会获得有关您自己的编码过程的反馈(更多有关下面的反馈)。

Bonus benefit of having this perspective on your coding process and having to explain it to your pair: Rubber-ducking is a fantastic way to debug code. In a nutshell, it involves explaining what you are trying to solve to a ‘rubber duck’ or another inanimate object, so that you get perspective on the issue. Why not explain to a real-life coder that you can bounce ideas off instead?

这种对您的编码过程有这种看法并必须向一对夫妇解释的好处是: 橡皮诱骗是一种调试代码的绝妙方法。 简而言之,它涉及到解释您要解决的“橡皮鸭”或其他无生命物体的问题,以便您对此问题有个看法。 为什么不向现实生活中的编码员解释您可以跳出主意呢?

(2)配对是练习良好软件开发至关重要的团队技能的绝佳环境。 ((2) Pairing is a great environment to practice the team skills that are central to good software development.)

We established earlier that software is a team sport. By taking your coding practice outside of your own head by pairing, you will naturally be building the soft team skills that are so vital to working in a larger software development team.

我们之前已经确定软件是一项团队运动。 通过配对将您的编码实践带到自己的头脑之外,您自然会建立软团队的技能,这对于在更大的软件开发团队中工作至关重要。

Coding interviews can often involve talking your interviewer through your thought process as you code or pseudo-code. With pairing practice, you will be able to clearly articulate your coding thoughts and give yourself the best chance you can in these pair-style interviews.

编码采访通常会涉及在您编码或伪代码时,通过您的思维过程来与您的采访者交谈。 通过配对练习,您将能够清楚地表达自己的编码思想,并在这些配对式访谈中为自己提供最大的机会。

(3)对(相对)新软件开发人员来说,结对编程的好处更大。 ((3) The benefits of pair programming are even greater for (relatively) new software developers.)

As supported by the research complied by Laurie Williams, pair coding works best when (i) the pair work on complex tasks and (ii) individuals are at similar levels of programming knowledge (see pair-programming research compiled by Laurie Williams).

劳瑞·威廉姆斯 ( Laurie Williams ) 编撰的研究结果表明,当(i)夫妻在复杂的任务上工作,并且(ii)个人具有相似的编程知识水平时,结对编码最有效( 请参阅劳瑞·威廉姆斯编纂的结对编程研究 )。

As a newly-minted coder stretching your way to greatness, a lot of the tasks you undertake will be naturally complex, because you don’t yet have that base of experience and knowledge that can make specific coding tasks easy. Your pair that is also learning to code is more likely to be at a similar level to you in a variety of coding knowledge areas, even if one of you is stronger in a specific area.

作为一个崭新的编码员,您将一路走到最伟大的道路,您承担的许多任务自然会很复杂,因为您尚不具备使特定编码任务变得容易的经验和知识基础。 即使在一个特定领域中,你们中的一个更强壮,也正在学习编码的那对夫妇在各种编码知识领域中的身价很可能相似

Beyond hardcore research, you can also take solace from the fact that the majority of prestigious coding bootcamps (designed to take people from newbie coders to junior developers in around 3 months) rely heavily on pair programming as a way for programmers to go from zero to hero as fast as possible.

除了核心研究之外,您还可以从大多数声望很高的编码训练营(旨在在3个月左右的时间内将新手编码人员带到初级开发人员)中解脱出来,这很大程度上依赖于结对编程,这是程序员从零到零的一种方式。英雄越快越好。

The fact that these intensive code-teaching bootcamps using pairing so much is a clear indicator that there is definitely a nugget of gold in using it to learn and learn fast. I myself discovered the glories of using pairing to learn at the coding bootcamp I attended, Makers Academy.

这些大量使用配对的密集型代码训练营的事实清楚地表明,使用它来学习和快速学习绝对是金矿。 我本人在我参加的Makers Academy编码训练营中发现了使用配对学习的荣耀。

If you are still skeptical, I challenge you to try pair coding. I could go on listing its benefits, but this will pale in comparison to trying it out, seeing its powers in practice, and ultimately deciding if it is a great a way to learn for you.

如果您仍然持怀疑态度, 我挑战您尝试配对编码 。 我可以继续列出它的好处,但是与尝试它,看到它在实践中的力量并最终确定它是否是为您学习的好方法相比,这将是苍白的。

好吧,我确信可以尝试一下,该如何开始? (OK I am convinced to give it a go, how do I start?)

First, find your pair (ideally a person that is of a similar skill level and also learning to code). This could be a friend you know who is learning to code or someone you meet along your coding journey.

首先,找到一对(理想情况下,这是一个具有相似技能水平并且还学会编码的人)。 这可能是您认识的朋友,谁正在学习编码,或者您在编码过程中遇到的某个人。

In-person pairing is ideal, but remote pairing is also great and can be a more convenient solution (for which you could use screen-sharing software such as Skype or Mikogo). In the workplace, pairing is frequently conducted between senior and junior developers, so that the junior can rapidly learn from the senior developer.

面对面配对是理想的选择,但是远程配对也很棒,并且可以是一个更方便的解决方案(可以使用诸如SkypeMikogo之类的屏幕共享软件)。 在工作场所中,经常在高级开发人员和初级开发人员之间进行配对,以便初级人员可以快速向高级开发人员学习。

如果您目前没有可以与之配对的人,那么该是时候建立您的开发者社区了。 (If you don’t currently have someone obvious you can pair with, it is time to start building your developer community.)

Knowing other developers is such an important aspect of learning to code in itself. You can bounce thoughts off people, develop ideas together, and learn from people with a range of backgrounds and strengths. This makes it worthwhile to pursue joining these communities just to meet other devs, finding someone to pair with is a tasty bonus.

认识其他开发人员是学习自身编码的重要方面。 您可以将想法反弹,与他人一起发展思想,并向具有各种背景和优势的人们学习。 这使得值得加入这些社区只是为了结识其他开发人员,找到与之配对的人是一个可口的奖励。

如果您是新编码员,我建议您通过两条肯定路线与其他开发人员会面: (If you are a new coder, I suggest two sure-fire routes to meeting other developers:)

(1) Join a coding community where people come together to code/ learn to code. For example in London, you could join ‘London Hackspace

(1)加入一个编码社区,在那里人们聚在一起编码/学习编码。 例如,在伦敦,您可以加入“ 伦敦Hackspace

(2) Attend coding community events, particularly those for new coders. A good route is attending an event run by a current bootcamp. Other coders checking out the bootcamp will be in a similar position to you.

(2)参加编码社区活动,尤其是针对新编码员的活动。 参加当前训练营举办的活动是一个不错的选择。 检出训练营的其他编码人员将与您处于相似的位置。

一旦找到可能的一对(或几个!),请尝试使用不同的对编程技术来找到您喜欢的一对: (Once you find a potential pair (or several!), try different pair programming techniques to find one you like:)

Below are two examples of pair programming techniques:

下面是对编程技术的两个示例:

(1) Pomodoro pairing. A timer is set for 25 minutes, where one person is the driver and the other the navigator. Every 25 minutes, you have a short break and switch roles. There is a great chrome extension for this here.

(1) 番茄配对。 计时器设置为25分钟,其中一个人是驾驶员,另一个人是导航员。 每隔25分钟,您就会有一个短暂的休息时间并切换角色。 有一个伟大的Chrome扩展这个位置

(2) Ping-pong pairing. The driver writes a failing test, then passes the driver role (and the keyboard) to the other person. The new driver writes the code to make that test pass, refactors the code, and writes a failing test for the other person to drive through. (To understand Test-Driven-Development, read point 1 here)

(2)乒乓球配对。 驾驶员编写了失败的测试,然后将驾驶员角色(和键盘)传递给其他人。 新的驱动程序将编写代码以使该测试通过,然后重构代码,并为其他人编写失败的测试进行驱动。 ( 要了解测试驱动开发,请在此处阅读要点1 )

For more pair programming techniques, watch:

有关更多对编程技术,请注意:

最后:平衡对编程的看法 (To end: balancing the view on pair programming)

Hopefully, you now feel inspired to add pair programming as a powerful tool to your learning toolbox. It really is very useful, and I hope you now have enough info to get started.

希望您现在受到启发,可以将配对编程作为强大的工具添加到学习工具箱中。 它确实非常有用,希望您现在掌握足够的信息以开始使用。

To balance the above: pair programming is, of course, not always easy. Learning to explain and externalize your coding process can be tough. Working with others can be difficult in general, and certain scenarios can reduce the value pair programming provides (for example if the skills or goals of the pair are mismatched).

为了达到上述平衡:结对编程当然并不总是那么容易。 学习解释和外部化您的编码过程可能很困难。 通常,与他人一起工作可能很困难,并且某些方案可能会降低编程对提供的价值(例如,如果一对的技能或目标不匹配)。

“Difficult things aren’t easy, but they’re worth it”
“困难的事情并不容易,但是值得。”

Mia love

米娅·爱

Fundamentally though, if you’re learning to code and learning to work in a software development team, I haven’t found anything more helpful than hours upon hours of pair programming with a wide range of people with different backgrounds and talents.

但是,从根本上讲,如果您正在学习编码并学习在软件开发团队中工作,那么我发现没有什么比几个小时与一对不同背景和才华横溢的人结对编程更有用的了。

When it comes down to it, most things in code (and life) come down to working well with others. The added bonus? Working with others has the excitement of heading in directions you may not expect, the rigor of ensuring high-quality code through disagreement and discussion, and maybe, just maybe, it will simply be a lot more fun!

归根结底,代码(和生活)中的大多数事情都归结为与他人良好合作。 增加的奖金? 与他人一起工作会带给您激动的方向,这是通过不同意见和讨论来确保高质量代码的严格要求,也许,也许仅仅是,这会变得更加有趣!

Looking for more coding secrets?

寻找更多的编码秘密?

This is the fifth post in a series that focuses on the secret meta-learnings I have picked up as I have learned to code at Makers Academy: the approaches, tools, and mindsets to make the breakthroughs you need to be a kick-ass coder.

这是本系列的第五篇文章,重点介绍了我在Makers Academy学习编程时所学到的秘密元学习:方法,工具和思维方式,以取得突破,成为一名踢kick的程序员。

Click here for my previous post: 5 ways to unstick yourself from sticky, tricky coding problems

单击此处查看我的上一篇文章:摆脱粘性棘手的编码问题的5种方法

If you enjoyed this blog post and would like to read more like it, please click ‘Follow’ and give me a few Claps by clicking the Medium claps button below ?

如果您喜欢这篇博客文章,并且想阅读更多类似的文章,请单击“关注”,并通过单击下面的“中等鼓掌”按钮给我一些鼓掌?

翻译自: https://www.freecodecamp.org/news/want-to-be-a-developer-you-should-probably-be-pair-programming-2c6ec12c4866/

结对编程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值