Why specs matter (为什么说设计说明书很重要)

四 25th, 2011 | Filed under 其他, 生活

大部分的程序员都是白痴,而余下的那部分都是狗屎。有时候我会觉得自己两者都属于,所以我敢信心十足的这么说。

狗屎

狗屎们在读设计说明书时会用一把密密的梳子仔细梳理里面的内容,查找里面的漏洞、疏忽、或简单的拼写错误。当开发程序时,他们会严格的按照说明书的需求规范——尽管是有问题的。当有人冲着他们叫喊说软件有问题时,他们会得意洋洋的指着说明书里的某些语句,这些语句清楚的表明这严重有问题的软件在技术上是完全没问题的,然后这个事件就会被他们放到博客里吹嘘一番。

在狗屎们里有一小撮人是写测试用例的。在写说明书的编写过程中这些人一般会留守,因为在说明书最终定版之前随时都会把他们抽过来投入无尽的查补漏洞的工作中。但不幸的是,狗屎们要比你想象的难对付的多,需要你花更多的时间。这就是为什么好设计说明书需要花这么长时间编写的原因:大部分的时间都消耗在了应付这些狗屎们的工作中。

白痴

白痴们,却是另外一种情况,他们从来不看设计说明书,直到有人冲着他们大喊大叫。他的做法通常是,先不知道是从哪而弄到了一些demo,然后按照这有限的demo开发出程序,差不多能用。自然,等这个产品发布后,他们不可避免的被人大呼小叫一番,因为有人碰巧用到了产品里的这部分功能,跟说明书里描述的这部分完全不一致。有人会指着说明书里的这些语句,这些语句表明了他们的程序里有多么严重的问题,于是白痴们才修改这些问题。

除了常见的白痴外,这还有两类特殊的白痴,值得提一下。前一种是做demo、打包程序,之后就像其他白痴一样被人叫骂的。但当他们被叫骂着要求去读一读设计说明书时,他们会神奇的转变成狗屎型,他们会嚷嚷着设计书含糊不清,有歧义,或者是可忽略不计——因为没有人会这样实现它或它本身是错的。这些人可以被称为激进分子。他们永远写不出符合要求的程序——不管设计书写的如何详细,这部分人可以被放心的忽略不计。

另外一种一小撮的白痴是写demo、打包程序,然后被人叫骂的。但当他们被要求去读一读设计书时,他们会神奇的变成唱赞歌的人,他们会把从这些错误中学得的经验写成指导性文章。这些人于是被人称作专家。事实上,世界上所有的教材指导都是由“白痴变成的专家”写成的。

天使

有些人可能会不服,说并不是所有的程序员都是白痴或狗屎。可是你们错了。例如,有些人会提出一种可以被称作“天使”的程序员。“天使们”读说明书仔细,然后写程序,在程序打包成产品前要通过测试套件进行周全的测试。可天使们其实并不存在,他们只是一个传说,好让软件说明书的编写者们心里感到欣慰。

为什么说软件设计说明书重要

如果你的说明书不够完善,那些白痴们绝对没有机会把事情做对。只要有人抱怨说他们的软件有问题了,必然会蹦出来两个狗屎进行否认。如果说明书的目的只是为了在跟白痴和狗屎们的纷争中进行仲裁,那它什么事情都解决不了,争执会压抑在心里郁积多年不散。

如果你的说明书写的足够好,白痴们就会有可能在第二次的时候经过努力把事情做对,而你也不会被狗屎们围攻。同时,那些只擅长找纰漏的狗屎们再也找不到任何东西,他们最终会愤懑不已、转而寻找其他的人进行骚扰。

翻译说明:这篇文章的原文结束后作者加了下面这样一句话:

这篇博客不再接受公开的评论,但你可以通过下面的表单里把评论发给我。(我不会把你的话公布。)

本人是个不太敏感的人,如果有人觉得把程序员说出“狗屎”和“白痴”太过分,请告知我。谢谢。

如下为原文:

Most developers are morons, and the rest are assholes. I have at various times counted myself in both groups, so I can say this with the utmost confidence.

Assholes

Assholes read specs with a fine-toothed comb, looking for loopholes, oversights, or simple typos. Then they write code that is meticulously spec-compliant, but useless. If someone yells at them for writing useless software, they smugly point to the sentence in the spec that clearly spells out how their horribly broken software is technically correct, and then they crow about it on their blogs.

There is a faction of assholes that write test cases. These people are good to have around while writing a spec, because they can occasionally be managed into channeling their infinite time and energy into finding loopholes before the spec is final. Unfortunately, managing assholes is even harder and more time-consuming than it sounds. This is why writing good specs takes so long: most of the time is frittered away on asshole management.

Morons

Morons, on the other hand, don’t read specs until someone yells at them. Instead, they take a few examples that they find “in the wild” and write code that seems to work based on their limited sample. Soon after they ship, they inevitably get yelled at because their product is nowhere near conforming to the part of the spec that someone else happens to be using. Someone points them to the sentence in the spec that clearly spells out how horribly broken their software is, and they fix it.

Besides the run-of-the-mill morons, there are two factions of morons that are worth special mention. The first work from examples, and ship code, and get yelled at, just like all the other morons. But then when they finally bother to read the spec, they magically turn into assholes and argue that the spec is ambiguous, or misleading in some way, or ignoreable because nobody else implements it, or simply wrong. These people are called sociopaths. They will never write conformant code regardless of how good the spec is, so they can safely be ignored.

The second faction of morons work from examples, ship code, and get yelled at. But when they get around to reading the spec, they magically turn into advocates and write up tutorials on what they learned from their mistakes. These people are called experts. Virtually every useful tutorial in the world was written by a moron-turned-expert.

Angels

Some people would argue that not all developers are morons or assholes, but they are mistaken. For example, some people posit the existence of what I will call the “angel” developer. “Angels” read specs closely, write code, and then thoroughly test it against the accompanying test suite before shipping their product. Angels do not actually exist, but they are a useful fiction to make spec writers to feel better about themselves.

Why specs matter

If your spec isn’t good enough, morons have no chance of ever getting things right. For everyone who complains that their software is broken, there will be two assholes who claim that it’s not. The spec, whose primary purpose is to arbitrate disputes between morons and assholes, will fail to resolve anything, and the arguments will smolder for years.

If your spec is good enough, morons have a fighting chance of getting things right the second time around, without being besieged by assholes. Meanwhile, the assholes who have nothing better to do than look for loopholes won’t find any, and they’ll eventually get bored and wander off in search of someone else to harass.

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪 ViVi 365Key 网摘 天极网摘 和讯网摘 博拉网 POCO 网摘 饭否 QQ 书签 Digbuzz 我挖网 Mister Wong
目前还没有任何评论.