The Broken Window Theory

本文探讨了破窗理论如何应用于软件开发中,强调修复坏设计、错误决策及劣质代码的重要性。通过对比整洁系统与混乱系统的差异,揭示忽视小问题如何导致整个项目的恶化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The Broken Window Theory

In a previous entry, I touched on the broken window theory. You might be familiar with the Pragmatic Progammers' take on this:

Don't leave "broken windows" (bad designs, wrong decisions, or poor code) unrepaired. Fix each one as soon as it is discovered. If there is insufficient time to fix it properly, then board it up. Perhaps you can comment out the offending code, or display a "Not Implemented" message, or substitute dummy data instead. Take some action to prevent further damage and to show that you're on top of the situation.

We've seen clean, functional systems deteriorate pretty quickly once windows start breaking. There are other factors that can contribute to software rot, and we'll touch on some of them elsewhere, but neglect accelerates the rot faster than any other factor.

That's excellent advice for programmers, but it's not the complete story.

broken windows

The broken window theory is based on an Atlantic Monthly article published in 1982. It's worth reading the article to get a deeper understanding of the human factors driving the theory:

Second, at the community level, disorder and crime are usually inextricably linked, in a kind of developmental sequence. Social psychologists and police officers tend to agree that if a window in a building is broken and is left unrepaired, all the rest of the windows will soon be broken. This is as true in nice neighborhoods as in rundown ones. Window-breaking does not necessarily occur on a large scale because some areas are inhabited by determined window-breakers whereas others are populated by window-lovers; rather, one unrepaired broken window is a signal that no one cares, and so breaking more windows costs nothing. (It has always been fun.)

Philip Zimbardo, a Stanford psychologist, reported in 1969 on some experiments testing the broken-window theory. He arranged to have an automobile without license plates parked with its hood up on a street in the Bronx and a comparable automobile on a street in Palo Alto, California. The car in the Bronx was attacked by "vandals" within ten minutes of its "abandonment." The first to arrive were a family--father, mother, and young son--who removed the radiator and battery. Within twenty-four hours, virtually everything of value had been removed. Then random destruction began--windows were smashed, parts torn off, upholstery ripped. Children began to use the car as a playground. Most of the adult "vandals" were well-dressed, apparently clean-cut whites. The car in Palo Alto sat untouched for more than a week. Then Zimbardo smashed part of it with a sledgehammer. Soon, passersby were joining in. Within a few hours, the car had been turned upside down and utterly destroyed. Again, the "vandals" appeared to be primarily respectable whites.

Untended property becomes fair game for people out for fun or plunder and even for people who ordinarily would not dream of doing such things and who probably consider themselves law-abiding. Because of the nature of community life in the Bronx--its anonymity, the frequency with which cars are abandoned and things are stolen or broken, the past experience of "no one caring"--vandalism begins much more quickly than it does in staid Palo Alto, where people have come to believe that private possessions are cared for, and that mischievous behavior is costly. But vandalism can occur anywhere once communal barriers--the sense of mutual regard and the obligations of civility--are lowered by actions that seem to signal that "no one cares."

There's even an entire book on this subject. What's fascinating to me is that the mere perception of disorder-- even with seemingly irrelevant petty crimes like graffiti or minor vandalism -- precipitates a negative feedback loop that can result in total disorder:

We suggest that "untended" behavior also leads to the breakdown of community controls. A stable neighborhood of families who care for their homes, mind each other's children, and confidently frown on unwanted intruders can change, in a few years or even a few months, to an inhospitable and frightening jungle. A piece of property is abandoned, weeds grow up, a window is smashed. Adults stop scolding rowdy children; the children, emboldened, become more rowdy. Families move out, unattached adults move in. Teenagers gather in front of the corner store. The merchant asks them to move; they refuse. Fights occur. Litter accumulates. People start drinking in front of the grocery; in time, an inebriate slumps to the sidewalk and is allowed to sleep it off. Pedestrians are approached by panhandlers.

At this point it is not inevitable that serious crime will flourish or violent attacks on strangers will occur. But many residents will think that crime, especially violent crime, is on the rise, and they will modify their behavior accordingly. They will use the streets less often, and when on the streets will stay apart from their fellows, moving with averted eyes, silent lips, and hurried steps. "Don't get involved." For some residents, this growing atomization will matter little, because the neighborhood is not their "home" but "the place where they live." Their interests are elsewhere; they are cosmopolitans. But it will matter greatly to other people, whose lives derive meaning and satisfaction from local attachments rather than worldly involvement; for them, the neighborhood will cease to exist except for a few reliable friends whom they arrange to meet.

Programming is insanely detail oriented, and perhaps this is why: if you're not on top of the details, the perception is that things are out of control, and it's only a matter of time before your project spins out of control. Maybe we should be sweating the small stuff.


### 回答1: 《Chtholly与破碎的计时仪》是一部轻小说,讲述了一个名叫Chtholly的女孩和她的伙伴们在一个神秘的世界中冒险的故事。在这个世界中,人们可以使用魔法和机械来探索和战斗。故事中,Chtholly和她的伙伴们遇到了许多挑战和困难,但他们最终克服了这些障碍,成为了真正的英雄。这部小说充满了冒险、魔法和机械,是一部非常有趣的作品。 ### 回答2: 《Chtholly和破碎的计时器》是一部日本轻小说系列《绯弹的亚里亚》的外传作品。故事发生在主系列之前,主要讲述了女主角Chtholly的冒险故事。 Chtholly是一个叫做“Leprechaun”的种族的成员,他们拥有独特的能力,可以战斗以保护人类和和平。她是一个非常乐观和坚强的少女,总是在面对困难和逆境时保持积极。然而,在这个故事中,她遇到了一些破碎的计时器,这改变了她的生活。 这些破碎的计时器代表了时间的流逝和终结的迫近。Chtholly发现自己越来越接近死亡,并且无法再使用她的力量进行战斗。她开始寻找解决办法,试图延长自己的寿命。但是,她的努力和她的伙伴们的帮助都无济于事。 尽管面临着生命逐渐消逝的威胁,Chtholly并没有放弃希望。她继续与她的朋友们一起战斗,并为了保护所爱的人而奋斗。她的勇气和坚持精神给予了周围的人们力量,让他们在困境中坚持下去。 《Chtholly和破碎的计时器》通过Chtholly的故事,揭示了生命的脆弱和宝贵。它提醒我们珍惜每一刻,不要轻言放弃,并在逆境中寻找希望和勇气。这个故事向我们展示了一个勇敢面对死亡的女孩,她用自己的力量改变了周围人的生活,并留下了一段深刻的记忆。 总而言之,《Chtholly和破碎的计时器》是一个令人感动和启发的故事,它让我们思考生命的意义和可贵,鼓励我们在困难中坚持下去,勇往直前。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值