如何抑制自己改写一切的冲动? [英] How to restrain one's self from the overwhelming urge to rewrite everything?

查看:82
本文介绍了如何抑制自己改写一切的冲动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否曾经经历过编写一段代码来进行看似简单的更改,然后意识到自己刚刚踏入了一个值得认真关注的荒原的经历?通常,在正式的 FREAK OUT 时刻进行跟进,在那一刻,重写视线中的所有内容的压倒性感觉开始逐渐升温.

Have you ever had the experience of going into a piece of code to make a seemingly simple change and then realizing that you've just stepped into a wasteland that deserves some serious attention? This usually gets followed up with an official FREAK OUT moment, where the overwhelming feeling of rewriting everything in sight starts to creep up.

重要的是要注意,此错误代码不一定来自其他人,因为它确实可能是我们过去编写或贡献的.

很明显,有一些严重的代码腐烂,可怕的体系结构等需要处理.与此问题相关的真正问题是,现在不是重写代码的合适时机.可能有很多原因:

It's obvious that there is some serious code rot, horrible architecture, etc. that needs to be dealt with. The real problem, as it relates to this question, is that it's not the right time to rewrite the code. There could be many reasons for this:

  • 当前处于发布周期的中间,因此任何更改都应该很小.
  • 现在是凌晨2:00,大脑开始关闭.
  • 这可能对时间表造成不利影响.
  • 这个时候兔子的洞可能比我们的眼睛能看到的深得多.
  • 等...

那么,在成为负责任的开发人员的同时,我们又该如何平衡不断改进代码的责任呢?我们如何避免对破窗理论做出贡献,行为及其可能引起的鲁re行为?

So how should we balance the duty of continuously improving the code, while also being a responsible developer? How do we refrain from contributing to the broken window theory, while also being aware of actions and the potential recklessness they may cause?

好答案!在大多数情况下,似乎有两种思想流派:

Great answers! For the most part, there seems to be two schools of thought:

  1. 不要抗拒这种冲动,因为它是一种好习惯.
  2. 不要屈服于诱惑,因为它会把你烧死.

知道更多的人是否感到任何平衡会很有趣.

It would be interesting to know if more people feel any balance exists.

推荐答案

我非常喜欢创建列表!

当您的冲动促使您重新编写某些东西时,请花10分钟时间列出需要重新编写的内容.遵循所有将您带入需要注意的代码的小巷,并列出其中的所有内容.

As soon as the urge takes you to re-write something - spend 10 minutes making a list of the things that need re-writing. Follow all of the alleys that take you further into the code that needs attention and list those, too.

希望在相对短的时间内,您将拥有以下两点之一:

Hopefully within a relatively short space of time you'll have one of two things:

  • 一个很长的清单,使您完全不想再重写任何内容.
  • 实际上没有那么长的清单,所以为什么不沉迷于自己去重写?!

这篇关于如何抑制自己改写一切的冲动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆