宜家 cdo_人们删除我们的代码时的宜家效应

宜家 cdo

Most, if not all, developers have experienced someone else deleting their code. And more often than not, anger is all we feel when they delete our code — the reason be damned. How dare they do such a thing?

大多数(如果不是全部)开发人员都经历过其他人删除其代码的情况。 而且,通常情况下,当他们删除代码时,我们所感到的只有愤怒,这是该死的原因。 他们怎么敢做这样的事?

For some of us, the code we write is sacred. Deleting it is akin to erasing a part of our existence. The removal of our creations that we painstakingly built is a cardinal sin. The mere thought of deleting our code should be a crime itself. It’s not uncommon to see similar strong responses from this perceived act of war.

对于我们中的某些人来说,我们编写的代码是神圣的。 删除它类似于删除我们存在的一部分。 移除我们辛苦打造的创作是一个主要的罪过。 仅仅删除我们的代码的想法本身就是犯罪。 从这种感知到的战争行为中看到类似的强烈React并不罕见。

This is partly due to the IKEA effect at work.

部分原因是由于宜家发挥了作用。

宜家效应 (The IKEA Effect)

This phenomenon was identified by Michael I. Norton of Harvard Business School, Daniel Mochon of Yale, and Dan Ariely of Duke. According to Wikipedia, it’s “a cognitive bias in which consumers place a disproportionately high value on products they partially created.”

哈佛商学院的Michael I. Norton,耶鲁大学的Daniel Mochon和杜克大学的Dan Ariely确认了这种现象。 根据Wikipedia所说,这是“一种认知偏见,在这种偏见中,消费者对他们部分创造的产品给予不成比例的高价值。”

“[Norton and his colleagues] described the IKEA effect as ‘labor alone can be sufficient to induce greater liking for the fruits of one’s labor: even constructing a standardized bureau, an arduous, solitary task, can lead people to overvalue their (often poorly constructed) creations.’” — Wikipedia

“ [Norton和他的同事]描述了IKEA的影响,因为“仅靠劳动就足以引起人们对劳动成果的更喜好:即使建立一个标准化的局,一项艰巨而孤独的任务,也会导致人们高估自己的价值(通常差强人意。建造)的作品。'” – 维基百科

Programming is not spared either. Each line of code you write is an amalgamation of your creativity, time, and effort — even when you put pieces together from strangers on Stack Overflow and Google your way out of any nasty bugs. No matter how the final product came to be, you would subconsciously value it more.

编程也不例外。 您编写的每一行代码都融合了您的创造力,时间和精力-即使您将来自陌生人的代码放到Stack Overflow和Google上,也可以摆脱任何讨厌的错误。 不管最终产品如何发展,您都将在潜意识里更加重视它。

And whether you know it or not, it’s also likely that you will grow feelings for your code. I mean, who wouldn’t after having invested so much into something?

而且,无论您是否知道,您都有可能会对代码产生兴趣。 我的意思是,在投入大量资金后,谁会不愿意?

踢球者 (The kicker)

You thought bugs were the only undesirable byproducts of coding. I’m sorry, you missed one: your feelings and emotions for your code.

您认为错误是唯一不受欢迎的编码副产品。 抱歉,您错过了其中之一:您对代码的感受和情感。

The code you wrote may be awful, but in your eyes, it’s a meticulously assembled masterpiece — faultless, functional, and beautiful. It’s perfect.

您编写的代码可能很糟糕,但是在您看来,它是精心组装的杰作-完美无缺,功能强大且美观。 这是完美的。

And that’s where we get blinded. We subconsciously place a higher value on the code we write. Whether our code is actually well-written or not doesn’t matter. We believe that it is, and as with all things we build, we tend to grow emotionally attached to it as well. Hence the indignation we feel when someone else deletes our code — even with a valid reason.

这就是我们蒙蔽的地方。 我们在潜意识里对编写的代码赋予更高的价值。 我们的代码是否写得好并不重要。 我们相信它是正确的,并且与我们构建的所有事物一样,我们也倾向于在情感上也越来越依赖它。 因此,即使有人出于正当理由,当别人删除我们的代码时,我们也会感到愤慨。

为什么您应该远离代码 (Why You Should Stay Detached From Your Code)

You should remain as detached from your code as possible. You can be emotionally invested in it, but code is just code. It doesn’t have any feelings. It can’t have any relationship with you. This is a one-sided affair that just isn’t going to work out.

您应该与代码保持尽可能的分离。 您可以在其中投入很多精力,但是代码仅仅是代码。 它没有任何感觉。 它与您没有任何关系。 这是单方面的事情,只是无法解决。

代码是一次性的 (Code is disposable)

And that’s the sad truth, no matter how perfectly designed it is.

这就是可悲的事实,无论它的设计多么完美。

The code you write at work exists to serve the business needs of your employer. The code you write for your projects exists to serve your boundless curiosity and appetite for tinkering with new things. And the code you write for your school assignments? That should be self-explanatory.

您在工作中编写的代码可以满足您雇主的业务需求。 您为项目编写的代码的存在是为了满足您无穷的好奇心和食欲,他们需要修补新事物。 而您为学校作业编写的代码呢? 那应该是不言自明的。

What do they all have in common? They are disposable. When the company’s business needs evolve, out goes the legacy code. When your interest in your pet projects fades away, their code becomes obsolete and rots on GitHub. When your semester ends, that assignment code is doomed to be forgotten as well.

它们有什么共同点? 它们是一次性的。 当公司业务需求发展时,遗留代码就消失了。 当您对宠物项目的兴趣逐渐消失时,其代码已过时并且在GitHub上烂掉了。 当您的学期结束时,该作业代码也注定会被忘记。

代码不断变化 (Code is ever-changing)

Code exists to do one thing and one thing only: solve problems. The thing is, problems are not constants. Over time, they may evolve and morph into entirely new problems.

存在的代码只能做一件事,而只能做一件事:解决问题。 问题是,问题不是常数。 随着时间的流逝,它们可能演变并演变为全新的问题。

When that happens, your old code will become obsolete. Its time is up.

发生这种情况时,您的旧代码将过时。 时间到了。

Take pride in your work, but do not be too emotionally invested in your code to the point where you’re blinded by everything else. All code has its expiry date. Don’t let your emotions get in the way when it’s time to bid your code farewell.

以您的工作为荣,但不要在代码上投入太多精力,以至于您对其他所有事情都不了解。 所有代码都有其有效期。 当您要告别代码时,不要让您的情绪受阻。

克服宜家效应 (Overcoming the IKEA Effect)

The next time you feel infuriated when your code gets deleted, take a step back and think before you do anything. It is essential to take note of any unjust prejudice and seek further clarification before making any judgments.

下次在删除代码时感到生气时,请退后一步,然后再做任何事情。 在做出任何判断之前,必须注意任何不公正的偏见并寻求进一步的说明。

Sort things out as soon as possible. The last thing you want is to leave it for later and completely forget about it.

尽快解决问题。 您想要的最后一件事是将其留待以后再完全忘记。

The clarification you seek never materializes and your unresolved frustration does not subside. Over time, it may result in built-up resentment and worsen relationships with the colleague or teammate who deleted your code. That’s the worst-case scenario and something you should actively work to avoid.

您寻求的澄清永远不会实现,您未解决的挫败感也不会消退。 随着时间的流逝,这可能会导致不满情绪,并加剧与删除代码的同事或队友的关系。 那是最坏的情况,您应该积极避免。

接受建设性的批评 (Accept constructive criticism)

The code you write is never perfect. Believing that it is, is utter foolishness.

您编写的代码从来都不是完美的。 相信事实是完全愚蠢的。

Code reviews are a great way for other developers to provide feedback on your work. They can scrutinize the changes you want to make, your rationale behind them, offer suggestions, and spot any mistakes you missed before the code goes to production.

代码审查是其他开发人员提供有关您的工作反馈的好方法。 他们可以仔细检查您想要进行的更改,其背后的原理,提供建议并找出在代码投入生产之前您遗漏的任何错误。

Learn to let go of your ego and listen to what others have to offer. Tap into the wealth of knowledge that other developers possess and capitalize on it. There’s not a single developer who knows everything.

学会放开自我,倾听他人所提供的东西。 充分利用其他开发人员拥有并利用的丰富知识。 没有一个开发人员会什么都知道。

Constructive criticism is an important part of the feedback loop in the quest to become a better developer.

建设性批评是寻求成为更好的开发人员时反馈循环的重要组成部分。

学习迭代和退出 (Learn to iterate and quit)

In the tech world, things move quickly. You’re going to be building things and breaking them at an astonishing pace. The key here is to understand the concept of failing fast and failing often.

在科技界,事情发展很快。 您将要以惊人的速度构建事物并打破它们。 这里的关键是要理解快速失败和经常失败的概念。

When you’ve accepted that, you will realize that it’s pointless to be emotionally attached to the code you write. You’ll probably throw away code faster than you can grow feelings for it.

当您接受了这一点后,您将意识到,情感上附着于您编写的代码毫无意义。 您扔掉代码的速度可能会比感觉快得多。

In fact, you might even end up enjoying deleting your old code. If you’ve reached this stage, welcome to enlightenment.

实际上,您甚至可能最终会喜欢删除旧代码。 如果您已经到了这个阶段,欢迎启蒙。

结论 (Conclusion)

While this phenomenon explains your initial biased reaction, it should not dictate your next action.

尽管这种现象解释了您最初的偏见,但它并不决定您的下一步行动。

Attempts to delete or modify your code are not personal attacks against you. There’s a clear distinction between criticism of your code and criticism of yourself. You are not the code you write.

尝试删除或修改您的代码不是针对您的人身攻击。 对您的代码的批评与对自己的批评之间有明显的区别。 您不是您编写的代码。

Learn to separate your emotional attachments and take an objective stance. Do not let your emotions cloud your judgment.

学会分离情感依恋并采取客观立场。 不要让自己的情绪笼罩您的判断力。

Let go of your ego, accept feedback, grow, and have fun along the way.

放开自我,接受反馈,成长,并在此过程中获得乐趣。

Thanks for reading. If you have experienced this before and wish to share, I would love to hear from you in the comments!

谢谢阅读。 如果您以前曾经历过并希望与大家分享,我很乐意在评论中听到您的声音!

翻译自: https://medium.com/better-programming/the-ikea-effect-when-people-delete-our-code-243405c151f3

宜家 cdo

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值