设计与研究

Paul Graham 2003-01-01

设计与研究

2003年1月

(本文源自2002年秋季NEPLS会议的主题演讲。)

访问这个国家的人常常惊讶地发现,美国人喜欢以询问”你是做什么的?“来开始对话。我从来不喜欢这个问题。我很少有一个简洁的答案。但我想我终于解决了这个问题。现在,当有人问我做什么时,我会直视他们的眼睛说”我正在设计一种新的Lisp方言。“我推荐这个答案给任何不喜欢被问及做什么的人。对话会立即转向其他话题。

我不认为自己在研究编程语言。我只是在设计一种,就像有人可能设计一座建筑、一把椅子或一种新字体一样。我不是在试图发现什么新东西。我只是想创造一种编程起来很舒服的语言。在某些方面,这个假设让生活轻松很多。

设计和研究之间的区别似乎是一个新与好的问题。设计不一定要新,但一定要好。研究不一定要好,但一定要新。我认为这两条路在顶端汇合:最好的设计通过使用新思想超越其前人,而最好的研究解决的不仅是新的问题,而且是真正值得解决的问题。所以最终我们的目标是相同的目的地,只是从不同的方向接近。

今天我要谈论的是从背面看你的目标是什么样子的。当你把编程语言视为设计问题而非研究课题时,你会做什么不同的事情?

最大的区别是你更关注用户。设计始于问,这是为谁而做的,他们从中需要什么?例如,一个好的建筑师不是先创建一个设计然后强加给用户,而是通过研究预期用户并找出他们需要什么来开始。

注意我说的是”他们需要的”,而不是”他们想要的”。我并不是说作为一名设计师工作意味着像快餐厨师一样工作,做客户告诉你的任何事情。这在艺术领域的各个领域都有所不同,但我不认为有任何领域是由那些完全按照客户要求做事的人做出最好的作品的。

在衡量好设计的标准是它对用户有多好用这一点上,顾客永远是对的。如果你写了一本让所有人都感到无聊的小说,或者一把坐着极不舒服的椅子,那么你的工作就很糟糕,就是这样。说小说或椅子是根据最先进的理论原理设计的,这并不是辩解。

然而,做出对用户有用的东西并不意味着简单地做用户告诉你做的事情。用户不知道所有的选择是什么,而且常常对他们真正想要的东西感到困惑。

这个悖论的答案,我认为是你必须为用户设计,但必须设计用户需要的东西,而不是仅仅设计他们说他们想要的东西。这很像做医生。你不能仅仅治疗病人的症状。当病人告诉你他们的症状时,你必须找出真正的问题所在,并治疗那个。

这种对用户的关注是一种公理,大多数好的设计实践都可以从中推导出来,大多数设计问题都围绕着它。

如果好的设计必须满足用户的需求,那么用户是谁?当我说设计必须为用户时,我并不是说好的设计旨在某种最低标准。你可以选择任何你想要的用户群体。例如,如果你在设计一个工具,你可以为从初学者到专家的任何人设计,而针对一个群体的好设计对另一个群体可能是坏的设计。关键是,你必须选择某个用户群体。我认为除非参考某个预期用户,否则你甚至无法谈论好或坏的设计。

如果预期用户包括设计师自己,你最有可能获得好的设计。当你为不包括你自己的群体设计东西时,它往往是为那些你认为比你不够复杂的人设计的,而不是更复杂的。

这是一个问题,因为无论多么仁慈,居高临下地看待用户似乎不可避免地会腐蚀设计师。我怀疑美国很少有住房项目是由期望住在那里的建筑师设计的。你可以在编程语言中看到同样的现象。C、Lisp和Smalltalk是为它们自己的设计师使用而创建的。Cobol、Ada和Java是为其他人使用而创建的。

如果你认为你在为白痴设计东西,那么很可能你设计的东西不够好,即使是对白痴来说。即使你为最复杂的用户设计东西,你仍然在为人类设计。在研究方面情况不同。在数学中,你选择抽象不是因为它们容易理解,而是因为它们能让证明更短。我认为这对科学大体上也是如此。科学思想并不是为了符合人体工程学。

在艺术领域,情况非常不同。设计完全是关于人的。人体是个奇怪的东西,但当你设计一把椅子时,那就是你设计的对象,没有办法回避。所有艺术都必须迎合人类的兴趣和局限性。例如,在绘画中,在其他条件相同的情况下,有人的画比没有人的画更有趣。文艺复兴时期的伟大画作都充满了人,这不仅仅是历史的偶然。如果不是这样,绘画作为媒介就不会拥有它所拥有的声望。

不管喜欢与否,编程语言也是为人类服务的,我怀疑人脑就像人体一样凹凸不平且特异。有些思想人们很容易掌握,有些则不然。例如,我们处理细节的能力似乎非常有限。正是这个事实使得编程语言一开始就是个好主意;如果我们能处理细节,我们可以直接用机器语言编程。

还要记住,语言主要不是完成程序的形式,而是程序必须在其中开发的东西。任何艺术领域的人都会告诉你,你可能需要不同的媒介来处理这两种情况。例如,大理石是完成思想的漂亮、耐用的媒介,但对于开发新思想来说,它却是一种无可救药的僵化媒介。

程序就像证明一样,是一棵树的修剪版本,这棵树过去到处都有错误的分支。所以语言的测试不仅仅是完成的程序在它里面看起来有多干净,而是到达完成程序的路径有多干净。一个能给你优雅完成程序的设计选择可能不会给你一个优雅的设计过程。例如,我写过几个定义宏的宏,充满了嵌套的反引号,现在看起来像小宝石,但写它们花费了数小时最丑陋的试错,而且坦率地说,我仍然不完全确定它们是正确的。

我们常常表现得好像语言的测试是完成的程序在它里面看起来有多好。当你看到同一个程序用两种语言编写,一个版本短得多时,这似乎很有说服力。当你从艺术的角度接近这个问题时,你不太可能依赖这种测试。你不想最终得到一个像大理石一样的编程语言。

例如,在软件开发中拥有一个交互式顶层(在Lisp中称为读取-求值-打印循环)是一个巨大的胜利。当你有一个这样的东西时,它对语言的设计有实际影响。它对于一个必须在使用前声明变量的语言来说效果不佳,例如。当你只是在顶层输入表达式时,你希望能够将x设置为某个值,然后开始对x做事情。你不想必须先声明x的类型。你可以对任何一个前提提出异议,但如果一个语言必须有顶层才能方便,而强制类型声明与顶层不兼容,那么任何强制类型声明的语言都不可能方便编程。

在实践中,要获得好的设计,你必须接近并保持接近你的用户。你必须不断在实际用户上校准你的想法,尤其是在开始时。简·奥斯汀的小说如此之好的原因之一是她把它们大声读给家人听。这就是为什么她从不沉溺于自我放纵的风景描述或矫饰的哲学思考。(哲学在那里,但它被编织进故事中,而不是像标签一样粘贴在上面。)如果你打开一本普通的”文学”小说,想象把它作为你写的东西大声读给朋友听,你会敏锐地感觉到那种东西对读者来说是多么令人难以忍受。

在软件世界,这个想法被称为”较差就是更好”。实际上,“较差就是更好”的概念中混合了几个想法,这就是为什么人们仍在争论较差是否真的更好。但这个混合中的主要思想之一是,如果你在构建新东西,你应该尽快将原型放到用户面前。

另一种方法可能叫做”万福玛丽亚策略”。你不是快速拿出原型并逐步改进它,而是试图在一次长传触地中创建完整、完成的产品。据我所知,这是灾难的根源。无数创业公司在互联网泡沫期间这样自我毁灭。我从未听说过有成功的案例。

软件世界之外的人可能没有意识到的是,“较差就是更好”的思想在整个艺术领域都有体现。例如,在绘画中,这个思想在文艺复兴时期被发现。现在几乎每个绘画老师都会告诉你,获得准确绘画的正确方法不是慢慢地围绕物体的轮廓工作,因为错误会累积,最后你会发现线条不相遇。相反,你应该在大致正确的地方画几条快速的线,然后逐渐完善这个初始草图。

在大多数领域,传统上原型是用不同材料制作的。要切割成金属的字体最初是用刷子在纸上设计的。要铸成青铜的雕像是用蜡建模的。要在挂毯上刺绣的图案是用墨水在纸上绘制的。要用石头建造的建筑是在较小规模的木材上测试的。

当油画在十五世纪首次流行时令人兴奋的原因是,你实际上可以从原型制作完成的作品。如果你愿意,可以做一个初步的绘图,但你不必受它约束;你可以在完成绘画时解决所有细节,甚至做重大改变。

在软件中你也可以这样做。原型不一定只是一个模型;你可以将其精制成成品。我认为你应该在可能的时候总是这样做。它能让你利用一路上获得的新见解。但也许更重要的是,它对士气有好处。

士气在设计中至关重要。我很惊讶人们不多谈论它。我的第一个绘画老师告诉我:当你画某样东西感到无聊时,画出来的东西看起来会很无聊。例如,假设你必须画一栋建筑,你决定单独画每一块砖。如果你愿意,你可以这样做,但如果你中途感到无聊并开始机械地画砖而不是观察每一块,那么画出来的效果会比仅仅暗示砖块要差。

通过逐步完善原型来建造东西对士气有好处,因为它能让你保持投入。在软件中,我的规则是:始终有可工作的代码。如果你正在写一小时内可以测试的东西,那么你有立即获得奖励的前景来激励你。在艺术领域也是如此,特别是在油画中。大多数画家从模糊的草图开始,然后逐步完善。如果你这样工作,那么原则上你永远不必在一天结束时留下看起来确实未完成的东西。确实,画家之间甚至有句谚语:“一幅画永远不会完成,你只是停止在上面工作。“这个想法对任何做过软件的人来说都很熟悉。

士气是难以设计给不够复杂用户的另一个原因。很难对自己不喜欢的东西保持兴趣。要做出好东西,你必须想”哇,这真的很棒”,而不是”这是什么垃圾;那些傻瓜会喜欢它”。

设计意味着为人类制造东西。但不仅仅是用户是人。设计师也是人。

注意这段时间我一直在谈论”设计师”。设计通常必须由单个人控制才能做好。然而,似乎几个人可以合作进行一个研究项目。这在我看来是研究和设计之间最有趣的区别之一。

艺术领域有著名合作的例子,但它们大多数似乎是分子结合而不是核融合的情况。在歌剧中,通常由一个人写剧本,另一个人写音乐。在文艺复兴时期,来自北欧的工匠经常被雇佣来做意大利绘画背景中的风景。但这些不是真正的合作。它们更像是罗伯特·弗罗斯特”好篱笆造就好邻居”的例子。你可以把好的设计实例粘在一起,但在每个单独的项目中,一个人必须处于控制地位。

我不是说好的设计要求一个人思考所有事情。没有什么比一个你信任其判断的人的建议更有价值了。但谈话结束后,关于做什么的决定必须由一个人来做。

为什么研究可以由合作者完成而设计不能?这是一个有趣的问题。我不知道答案。也许,如果设计和研究汇合,最好的研究也是好的设计,而且实际上不能由合作者完成。许多最著名的科学家似乎都是独自工作的。但我了解得不够多,无法说这里是否有模式。这可能仅仅是因为许多著名科学家工作时合作不那么普遍。

无论科学领域的情况如何,真正的合作在艺术领域似乎极为罕见。委员会设计是坏设计的同义词。为什么会这样?有什么方法可以克服这个限制吗?

我倾向于认为没有——好的设计需要一个独裁者。一个原因是好的设计必须是一体的。设计不仅是为人类,而是为单个的人。如果一个设计代表的思想适合一个人的头脑,那么这个思想也会适合用户的头脑。

相关链接:

Design and Research

January 2003

(This article is derived from a keynote talk at the fall 2002 meeting of NEPLS.)

Visitors to this country are often surprised to find that Americans like to begin a conversation by asking “what do you do?” I’ve never liked this question. I’ve rarely had a neat answer to it. But I think I have finally solved the problem. Now, when someone asks me what I do, I look them straight in the eye and say “I’m designing a new dialect of Lisp.” I recommend this answer to anyone who doesn’t like being asked what they do. The conversation will turn immediately to other topics.

I don’t consider myself to be doing research on programming languages. I’m just designing one, in the same way that someone might design a building or a chair or a new typeface. I’m not trying to discover anything new. I just want to make a language that will be good to program in. In some ways, this assumption makes life a lot easier.

The difference between design and research seems to be a question of new versus good. Design doesn’t have to be new, but it has to be good. Research doesn’t have to be good, but it has to be new. I think these two paths converge at the top: the best design surpasses its predecessors by using new ideas, and the best research solves problems that are not only new, but actually worth solving. So ultimately we’re aiming for the same destination, just approaching it from different directions.

What I’m going to talk about today is what your target looks like from the back. What do you do differently when you treat programming languages as a design problem instead of a research topic?

The biggest difference is that you focus more on the user. Design begins by asking, who is this for and what do they need from it? A good architect, for example, does not begin by creating a design that he then imposes on the users, but by studying the intended users and figuring out what they need.

Notice I said “what they need,” not “what they want.” I don’t mean to give the impression that working as a designer means working as a sort of short-order cook, making whatever the client tells you to. This varies from field to field in the arts, but I don’t think there is any field in which the best work is done by the people who just make exactly what the customers tell them to.

The customer is always right in the sense that the measure of good design is how well it works for the user. If you make a novel that bores everyone, or a chair that’s horribly uncomfortable to sit in, then you’ve done a bad job, period. It’s no defense to say that the novel or the chair is designed according to the most advanced theoretical principles.

And yet, making what works for the user doesn’t mean simply making what the user tells you to. Users don’t know what all the choices are, and are often mistaken about what they really want.

The answer to the paradox, I think, is that you have to design for the user, but you have to design what the user needs, not simply what he says he wants. It’s much like being a doctor. You can’t just treat a patient’s symptoms. When a patient tells you his symptoms, you have to figure out what’s actually wrong with him, and treat that.

This focus on the user is a kind of axiom from which most of the practice of good design can be derived, and around which most design issues center.

If good design must do what the user needs, who is the user? When I say that design must be for users, I don’t mean to imply that good design aims at some kind of lowest common denominator. You can pick any group of users you want. If you’re designing a tool, for example, you can design it for anyone from beginners to experts, and what’s good design for one group might be bad for another. The point is, you have to pick some group of users. I don’t think you can even talk about good or bad design except with reference to some intended user.

You’re most likely to get good design if the intended users include the designer himself. When you design something for a group that doesn’t include you, it tends to be for people you consider to be less sophisticated than you, not more sophisticated.

That’s a problem, because looking down on the user, however benevolently, seems inevitably to corrupt the designer. I suspect that very few housing projects in the US were designed by architects who expected to live in them. You can see the same thing in programming languages. C, Lisp, and Smalltalk were created for their own designers to use. Cobol, Ada, and Java, were created for other people to use.

If you think you’re designing something for idiots, the odds are that you’re not designing something good, even for idiots. Even if you’re designing something for the most sophisticated users, though, you’re still designing for humans. It’s different in research. In math you don’t choose abstractions because they’re easy for humans to understand; you choose whichever make the proof shorter. I think this is true for the sciences generally. Scientific ideas are not meant to be ergonomic.

Over in the arts, things are very different. Design is all about people. The human body is a strange thing, but when you’re designing a chair, that’s what you’re designing for, and there’s no way around it. All the arts have to pander to the interests and limitations of humans. In painting, for example, all other things being equal a painting with people in it will be more interesting than one without. It is not merely an accident of history that the great paintings of the Renaissance are all full of people. If they hadn’t been, painting as a medium wouldn’t have the prestige that it does.

Like it or not, programming languages are also for people, and I suspect the human brain is just as lumpy and idiosyncratic as the human body. Some ideas are easy for people to grasp and some aren’t. For example, we seem to have a very limited capacity for dealing with detail. It’s this fact that makes programing languages a good idea in the first place; if we could handle the detail, we could just program in machine language.

Remember, too, that languages are not primarily a form for finished programs, but something that programs have to be developed in. Anyone in the arts could tell you that you might want different mediums for the two situations. Marble, for example, is a nice, durable medium for finished ideas, but a hopelessly inflexible one for developing new ideas.

A program, like a proof, is a pruned version of a tree that in the past has had false starts branching off all over it. So the test of a language is not simply how clean the finished program looks in it, but how clean the path to the finished program was. A design choice that gives you elegant finished programs may not give you an elegant design process. For example, I’ve written a few macro-defining macros full of nested backquotes that look now like little gems, but writing them took hours of the ugliest trial and error, and frankly, I’m still not entirely sure they’re correct.

We often act as if the test of a language were how good finished programs look in it. It seems so convincing when you see the same program written in two languages, and one version is much shorter. When you approach the problem from the direction of the arts, you’re less likely to depend on this sort of test. You don’t want to end up with a programming language like marble.

For example, it is a huge win in developing software to have an interactive toplevel, what in Lisp is called a read-eval-print loop. And when you have one this has real effects on the design of the language. It would not work well for a language where you have to declare variables before using them, for example. When you’re just typing expressions into the toplevel, you want to be able to set x to some value and then start doing things to x. You don’t want to have to declare the type of x first. You may dispute either of the premises, but if a language has to have a toplevel to be convenient, and mandatory type declarations are incompatible with a toplevel, then no language that makes type declarations mandatory could be convenient to program in.

In practice, to get good design you have to get close, and stay close, to your users. You have to calibrate your ideas on actual users constantly, especially in the beginning. One of the reasons Jane Austen’s novels are so good is that she read them out loud to her family. That’s why she never sinks into self-indulgently arty descriptions of landscapes, or pretentious philosophizing. (The philosophy’s there, but it’s woven into the story instead of being pasted onto it like a label.) If you open an average “literary” novel and imagine reading it out loud to your friends as something you’d written, you’ll feel all too keenly what an imposition that kind of thing is upon the reader.

In the software world, this idea is known as Worse is Better. Actually, there are several ideas mixed together in the concept of Worse is Better, which is why people are still arguing about whether worse is actually better or not. But one of the main ideas in that mix is that if you’re building something new, you should get a prototype in front of users as soon as possible.

The alternative approach might be called the Hail Mary strategy. Instead of getting a prototype out quickly and gradually refining it, you try to create the complete, finished, product in one long touchdown pass. As far as I know, this is a recipe for disaster. Countless startups destroyed themselves this way during the Internet bubble. I’ve never heard of a case where it worked.

What people outside the software world may not realize is that Worse is Better is found throughout the arts. In drawing, for example, the idea was discovered during the Renaissance. Now almost every drawing teacher will tell you that the right way to get an accurate drawing is not to work your way slowly around the contour of an object, because errors will accumulate and you’ll find at the end that the lines don’t meet. Instead you should draw a few quick lines in roughly the right place, and then gradually refine this initial sketch.

In most fields, prototypes have traditionally been made out of different materials. Typefaces to be cut in metal were initially designed with a brush on paper. Statues to be cast in bronze were modelled in wax. Patterns to be embroidered on tapestries were drawn on paper with ink wash. Buildings to be constructed from stone were tested on a smaller scale in wood.

What made oil paint so exciting, when it first became popular in the fifteenth century, was that you could actually make the finished work from the prototype. You could make a preliminary drawing if you wanted, but you weren’t held to it; you could work out all the details, and even make major changes, as you finished the painting.

You can do this in software too. A prototype doesn’t have to be just a model; you can refine it into the finished product. I think you should always do this when you can. It lets you take advantage of new insights you have along the way. But perhaps even more important, it’s good for morale.

Morale is key in design. I’m surprised people don’t talk more about it. One of my first drawing teachers told me: if you’re bored when you’re drawing something, the drawing will look boring. For example, suppose you have to draw a building, and you decide to draw each brick individually. You can do this if you want, but if you get bored halfway through and start making the bricks mechanically instead of observing each one, the drawing will look worse than if you had merely suggested the bricks.

Building something by gradually refining a prototype is good for morale because it keeps you engaged. In software, my rule is: always have working code. If you’re writing something that you’ll be able to test in an hour, then you have the prospect of an immediate reward to motivate you. The same is true in the arts, and particularly in oil painting. Most painters start with a blurry sketch and gradually refine it. If you work this way, then in principle you never have to end the day with something that actually looks unfinished. Indeed, there is even a saying among painters: “A painting is never finished, you just stop working on it.” This idea will be familiar to anyone who has worked on software.

Morale is another reason that it’s hard to design something for an unsophisticated user. It’s hard to stay interested in something you don’t like yourself. To make something good, you have to be thinking, “wow, this is really great,” not “what a piece of shit; those fools will love it.”

Design means making things for humans. But it’s not just the user who’s human. The designer is human too.

Notice all this time I’ve been talking about “the designer.” Design usually has to be under the control of a single person to be any good. And yet it seems to be possible for several people to collaborate on a research project. This seems to me one of the most interesting differences between research and design.

There have been famous instances of collaboration in the arts, but most of them seem to have been cases of molecular bonding rather than nuclear fusion. In an opera it’s common for one person to write the libretto and another to write the music. And during the Renaissance, journeymen from northern Europe were often employed to do the landscapes in the backgrounds of Italian paintings. But these aren’t true collaborations. They’re more like examples of Robert Frost’s “good fences make good neighbors.” You can stick instances of good design together, but within each individual project, one person has to be in control.

I’m not saying that good design requires that one person think of everything. There’s nothing more valuable than the advice of someone whose judgement you trust. But after the talking is done, the decision about what to do has to rest with one person.

Why is it that research can be done by collaborators and design can’t? This is an interesting question. I don’t know the answer. Perhaps, if design and research converge, the best research is also good design, and in fact can’t be done by collaborators. A lot of the most famous scientists seem to have worked alone. But I don’t know enough to say whether there is a pattern here. It could be simply that many famous scientists worked when collaboration was less common.

Whatever the story is in the sciences, true collaboration seems to be vanishingly rare in the arts. Design by committee is a synonym for bad design. Why is that so? Is there some way to beat this limitation?

I’m inclined to think there isn’t— that good design requires a dictator. One reason is that good design has to be all of a piece. Design is not just for humans, but for individual humans. If a design represents an idea that fits in one person’s head, then the idea will fit in the user’s head too.

Related: