不要与破碎的Windows一起生活

by Simon Foster

西蒙·福斯特(Simon Foster)

不要与破碎的Windows一起生活 (Don’t Live with Broken Windows)

Last night I started reading The Pragmatic Programmer by Andrew Hunt and David Thomas. One practical tip that immediately jumped out at me as useful in my quest to be a better programmer: Don’t live with broken windows.

昨晚我开始阅读安德鲁•亨特(Andrew Hunt)和大卫•托马斯(David Thomas)的“实用程序员” 。 一个实用的技巧立即引起了我的注意,这对我寻求成为一个更好的程序员很有用: 不要生活在破碎的窗户里。

The theory goes like this: an abandoned building with a single broken window attracts additional broken windows, graffiti, litter, and a sense that no one cares about this building. However this can be avoided if the authorities repair the window straight away.

理论上是这样的:一栋废弃的建筑物只有一个破损的窗户,会吸引更多的破损窗户,涂鸦,乱扔垃圾,而且没有人会关心这座建筑物。 但是,如果当局立即修复窗户,可以避免这种情况。

You can apply this theory to other walks of life, too, like keeping your kitchen clean. After you’ve spent hours cleaning your kitchen to make it spotless, you make an effort to keep it clean. But if your kitchen is piled high with dirty pans, leaving out an extra mug or dirty bowl isn’t going to feel like it makes any difference.

您也可以将此理论应用于其他各行各业,例如保持厨房清洁。 在花费数小时清洁厨房以使其一尘不染之后,您将努力保持厨房清洁。 但是,如果您的厨房里堆满了脏盘子,那么多余的杯子或脏碗就不会有什么区别。

The software engineering implications of this theory are that if you take care to keep your code tidy, it will stay that way. If you know something is broken but never make time to fix it, other bugs and issues will creep into it, until it’s a mess that no one dares touch.

该理论对软件工程的启示是,如果您注意保持代码整洁,它将保持这种状态。 如果您知道某个问题已损坏,但从未花时间对其进行修复,则其他错误和问题将蔓延到其中,直到没有人敢碰到的混乱为止。

We have a website that is starting to get a bit buggy. It’s not broken, but it’s been a while since anyone has given it any love. Bits of its functionality are starting to get flaky.

我们的网站开始出现漏洞。 它没有破裂,但是已经有一段时间了,因为有人给了它任何爱。 它的某些功能开始变得片状。

Being the only programmer in my place of work, I seldom have time to think about this website — let alone sit down and maintain it.

作为我工作场所中唯一的程序员,我很少有时间考虑这个网站-更不用说坐下来维护它了。

But the number of related support calls have been gradually increasing — more windows are breaking — and I’m spending more and more time patching its bugs to keep people happy.

但是相关支持电话的数量一直在逐渐增加-越来越多的窗户正在被打破-而且我花了越来越多的时间来修补其错误以使人们满意。

Know that I’m aware of the broken windows principle, I know exactly what to do: sit down with this website for a couple of days and find out what exactly is causing these issues.

知道我知道Windows坏了的原理,我确切地知道该怎么做:在这个网站上坐了几天,找出导致这些问题的确切原因。

Then I’ll rebuild the flaky bits, replace the proverbial cracked glass, and wash down a few walls while I’m at it.

然后,我将重建薄片状碎片,更换众所周知的破裂玻璃,并在冲洗时洗净几堵墙。

翻译自: https://www.freecodecamp.org/news/pragmatic-programmer-broken-windows-6916998eecbe/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值