取消蓝牙配对代码_配对代码审查

取消蓝牙配对代码

I discussed the value of pair programming with friends recently. A lot has been written on the topic, but I realized that I have an interesting experience with a less mentioned tool: pair code review.

我最近与朋友讨论了结对编程的价值。 关于该主题的文章很多,但是我意识到我对使用一个较少提及的工具有很好的体验:结对代码审查。

If pair programming doesn’t work for you for any reason, we can do better than the regular code-review-comment-fix-repeat loop. Here is a personal account of my experience, the pros and cons, and when I would use it.

如果结对编程由于某种原因对您不起作用,我们可以比常规的code-review-comment-fix-repeat循环做得更好。 这是我的经历,利弊以及何时使用的个人说明。

充分利用配对编程 (Making the most of pair programming)

Pair programming has been an established practice with many benefits (even some less obvious like keeping the WIP low). I usually find most of the value in three things: knowledge sharing, making better design decisions from the start, and getting unstuck faster.

结对编程已成为一种既定做法,它具有许多 优点 (甚至有些不那么明显,例如将WIP保持为较低)。 我通常会从三件事中找到大部分价值:知识共享,从一开始就做出更好的设计决策以及更快地解决问题。

The knowledge-sharing aspect is strongest when working with new people. That’s when we can learn the most from each other, get exposed to our different experiences. Beyond fixing typos or simple errors, we can share the reasoning behind our design choices, discuss the underlying principles we follow, exchange productivity tips, … Even with colleagues I have been in the office with for a long time, I often don’t get the feeling that I really know them until our first pair coding or debugging session, and it helps to build mutual respect.

与新人一起工作时,知识共享方面最强。 那是我们可以互相学习最多,接触到不同经验的时候。 除了纠正错别字或简单的错误外,我们还可以分享设计选择背后的理由,讨论我们遵循的基本原理,交换生产率提示,...即使与我在办公室工作了很长时间的同事, 我经常也没有在我们第一次进行编码或调试会话之前,我一直真正了解它们,这有助于建立相互尊重

The knowledge sharing advantages increasingly diminish over time, however. We have fewer new inputs to exchange. The better we know each other, the better I can simulate the other’s opinion in my mind and predict what I will hear during a code review. In a way, I have a little virtual colleague in my head I can pair up with.

但是,随着时间的流逝,知识共享的优势逐渐减少。 我们需要交换的新投入更少。 我们彼此之间了解得越多,就越能在我的脑海中模拟对方的意见并预测在代码审查期间将听到的内容。 在某种程度上,我的脑海中有一个可以与之配对的虚拟同事。

This has happened to me several times. Looking back, though, I learned the most from a really smart colleague who never liked pair programming. So how did I learn so much from him?

这发生在我身上好几次了。 但是,回顾过去,我从一个真正聪明的同事那里学到了很多东西,他从不喜欢结对编程。 那么我如何从他那里学到很多东西呢?

配对代码审查 (Pair code review)

My colleague preferred coding alone but he also disliked electronic tools for code review. He would write his code review notes down on a tiny sheet of paper and then we would sit together and he would guide me through the notes — all the things I missed, poor design choices, opportunities for improvement, etc. This was exactly the opportunity where we would discuss our guiding principles, productivity tips, and everything. And the next time I would do the same for him.

我的同事只喜欢编码,但他也不喜欢用于代码审查的电子工具。 他会把他的代码审查笔记写在一张小纸上,然后我们坐在一起,他会指导我完成笔记 -我错过的所有事情,糟糕的设计选择,改进的机会等。这正是机会在这里我们将讨论我们的指导原则,生产率提示以及所有内容。 下次我会为他做同样的事情。

It felt just like pair programming, just more compressed, limited to only what deserved the increased attention. In some regards, it was even better — when you are forced to tackle a problem on your own and then get feedback, you often learn more than if you are guided through every step. And over time, this was enough to reach the state where I could hear his voice in my head when I was making design choices.

感觉 就像结对编程一样,只是更加压缩 ,仅限于应引起更多关注的内容 。 在某些方面,这甚至更好-当您被迫独自解决问题然后获得反馈时,与逐步指导每个人相比,您经常学到更多。 随着时间的流逝,这足以使我在做出设计选择时可以听到他的声音。

Another important practice was that we wouldn’t just explain the review notes, we would often go and fix things together — in a pair programming session. This prevents the frequent cause of long lead time when the code review bounces back and forth in several rounds.

另一个重要的做法是,我们不仅会解释审阅说明,还会经常在成对编程会话中一起解决问题 。 这样可以避免在几轮回合中反复执行代码回顾时导致交货时间长的常见原因。

In short, pair code review often gave us many of the benefits of pair programming in less time.

简而言之,经常对代码进行审查 在更少的时间内为我们提供了结对编程的许多好处。

配对代码复习我不是什么意思 (What I don’t mean by pair code review)

I should emphasize that by pair code review I don’t mean inspecting the changes (pull request) together. I have tried that too but never found it effective. The pressure of the author’s presence interfered with my concentration and depth of inspection.

我应该强调的是,通过配对代码审阅我并不是要一起检查更改 (拉动请求)。 我也尝试过,但从未发现它有效。 作者在场的压力干扰了我的专心和检查的深度。

Image for post
Sometimes it’s difficult to get your idea over through a code review tool, asynchronously, as the lead time grows (several hours and several context switches in this case)
有时,随着交付时间的增加,很难通过代码查看工具异步地传达您的想法(这种情况下需要几个小时和几个上下文切换)

陷阱 (The traps)

Of course, there are hidden traps and many ways how not to do a pair code review. Probably more so than with regular pair programming.

当然,这里有隐藏的陷阱,还有许多不进行配对代码审查的方法。 可能比常规的结对编程更多。

后期反馈 (Late feedback)

The most obvious problem is that getting feedback late can be very inefficient if it means rewriting a lot of code or you no longer have the willpower to change a poor design choice.

最明显的问题是,如果这意味着重写大量代码,或者您不再具有改变糟糕的设计选择的意愿,那么迟到的反馈可能会非常无效率。

Not everything is lost, though. The reviews should be done frequently, preferably on small pieces of code. Most importantly, we learned to reach out for advice early and often whenever we got to a decision that might be difficult to change.

但是,并非一切都丢失了。 评审应经常进行,最好是在少量代码上进行。 最重要的是,我们学会了尽早地寻求建议,并且经常在每一次做出可能难以改变的决定时寻求帮助。

Keep in mind it requires a certain level of maturity, trust, and understanding to discern the right questions and time to ask. Disrupting flow is a factor; on the other hand, juniors are often too hesitant to ask for help when they get stuck on a problem (and that’s where pair programming can really save loads of time).

请记住,它需要一定程度的成熟度,信任度和理解力,才能识别正确的问题和提出问题的时间。 扰流是一个因素。 另一方面,初中生在遇到问题时常常不愿寻求帮助(这是结对编程可以真正节省大量时间的地方)。

公开反馈 (Openness to feedback)

Trust and openness are also important to accept a constructive critique and change one’s mind after the code is finished, otherwise, the effect of pair code review will be strongly reduced.

信任和开放对于接受建设性的批判并在代码完成后改变主意也很重要,否则,将大大降低配对代码审查的影响。

草率的代码审查 (Sloppy code review)

Conversely, the reviewer must not be afraid to speak her mind and point out things that are worth changing or discussing. The coder and reviewer can rely too much on each other without making it explicit and let problems slide unnoticed.

相反,审稿人一定不要害怕说出自己的想法并指出值得更改或讨论的内容。 编码人员和审阅者可能彼此过度依赖,而又没有使之明确,并使问题不被注意。

何时使用配对验证码 (When to use pair code review)

As a rule of thumb, I have a higher preference for pair coding until we get to know each other really well, harmonize our approaches, build trust, and learn when to ask to get unstuck. Then as advantages of pair programming for daily work diminish, I would transition to pair code review.

根据经验,我对结对编码有较高的偏爱,直到我们真正了解彼此,协调我们的方法,建立信任并了解何时要求解脱为止。 然后,随着配对编程在日常工作中的优势减弱,我将过渡到配对代码审查。

I would prefer pair programming with juniors (though not all the time) and new team members, when starting a new project, or to bounce ideas off each other when trying to crack a tough bug or problem.

在开始一个新项目时,我更喜欢与初级人员(尽管不是所有时间 )和新团队成员结对编程,或者在尝试破解一个棘手的错误或问题时互相激发想法。

I would prefer pair code review when I know the colleague well enough to know what to expect, especially if pair programming is not so practical, e.g., because we have a too different pace of work. Alternatively, you may find pair review useful to ease colleagues with an aversion to pairing into pair programming.

当我对同事足够了解并期望会发生什么时,我更希望使用配对代码复习,尤其是在配对编程不那么实际的情况下,例如,因为我们的工作节奏差异太大。 另外,您可能会发现配对复习对缓解同事对配对编程的厌倦很有用。

摘要 (Summary)

By pair code review, I mean a practice where the reviewer inspects the code, then sits together with the author, and guides the author through the comments, fixing them together.

通过配对代码审查,我的意思是 做法是,审阅者检查代码,然后与作者坐在一起,并指导作者完成注释,然后将注释固定在一起。

I don’t mean to argue that code reviews are better than pair coding. I’m trying to say that in situations where pair coding is not the best option, we can do better than just regular code review — and pair code review can go a long way.

我的意思不是说代码审查比配对编码更好。 我想说的是,在配对编码不是最佳选择的情况下,我们可以做得比常规的代码审查还要好-配对代码审查可以走很长一段路。

Even though it is not a practice that’s mentioned a lot, I’m glad to have it in my toolbox. I invite you to experiment and see how useful it is for you.

即使没有大量提及这种做法,我也很高兴能在工具箱中使用它。 我邀请您尝试一下,看看它对您有多有用。

翻译自: https://medium.com/@jan.michelfeit/pair-code-review-4f6ef6c81b57

取消蓝牙配对代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值