Doing the Simplest Thing That Could Possibly Work
DDJ: You once wrote, "We're told: Always put checks in, always look for exceptions, always handle the most general case, always give the best user advice, always print a meaningful error message, always this, always that. There are so many things in the background that you're supposed to do that there's no room left to think. I say forget all that and ask yourself, 'What's the simplest thing that could possibly work?'" But in many ways those voices that you suggest holding in abeyance keep us from writing smelly code that generates debt that has to be resolved later on. Where is the balance between those two things?
Cunningham: Actually, there's a path where you get to address them both at the right time. If I've got a month to work on a project, I have to ask, "What am I going to do the first week?" In fact, when I go in there on the first day of the first week, I have to ask, "What am I going to do on the first day?" I have to be making progress everyday. But if you think about too many things at once, you get into this kind of fearful state.
Sometimes you have to consciously ignore things that you know you're going to have to do. And those could be things that you just always have to do. And they might be things that people have told you you're going to have to do. That ability to focus is critical. To do the simplest thing you know.
Long ago, Kent Beck and I would be talking over coffee about what we might or might not do. And we would look at each other and say, "Well, let's go see if we can do it." And we would run downstairs to our office and sit side by side at a Smalltalk machine and just start coding in it. And sometimes it just delivered. Other times we'd sit there and minutes would go by. More minutes would go by. We'd think, "Why is this hard?" "What are we missing?" And we would feel that there was something wrong in the system, but we had no idea where the next step was. And that's when I realized that we had to free ourselves from whatever we thought we were supposed to do. And I just asked the question, "What is the simplest thing that could possibly work?" And you drop whatever you thought the solution was to what you were trying to do, and you say, "Well, if you wanted to make it really simple, you would just return the right answer. Or just look it up in a table." Or something that would be embarrassing to have your colleagues look at it and see what you've done. But you know, you could say, "We could do that. Let's just do it. We've been wasting 45 minutes on this problem, and we could do that simple thing in one minute." And we'd see it work. And then as soon as we'd see it work, we'd think of three more things we could do, maybe other ways to solve that problem or three other problems that are related that we didn't even realize we had, but it was like a door swinging open. And on the other side of that door was just fun things to work with. And the fact that we would sit there banging our head against this door for 45 minutes and not reach down and turn the handle because we thought we would be embarrassed to have cheated that way.
DDJ: But eventually...
Cunningham: Of course, at the end of the day you have to say, "Have I made code that I can live with?"
How Many Design Patterns Are Enough?
DDJ: Patterns were the prime motivation in your original design of the wiki. It seems that one level there are far too many patterns. I think that most developers today who are familiar with the Gang of Four (GoF) patterns are familiar with a subset. I'm not sure that, for example, that everybody walks around knowing how to implement the interpreter pattern, for example. On the other hand, I see you developing a vast collection of patterns. To what extent should patterns be a part of a developer's life, and in answering that question, to what extent should the full set of 23 GoF patterns be an integral part of developers' lives?
Cunningham: Good question. You know, I said nice things about the Heads First Design Patterns book. And one thing that they did is they said, "These are the 12 patterns that everybody uses, and if you're working on a job, there are these words, and you'd better learn them. And we're going to make learning them easy." That was a recognition of the success of the original Design Patterns book. So the fact is, anymore, you don't even have to study that stuff. If you're just an everyday programmer, those words get kicked around so much that you'll learn them by association.
The impact of patterns hasn't been so much in the written form, but just the fact that people use the words effectively and fairly precisely. Maybe proxy is used too many ways. But the basic patterns have done their job. And then of course, you should ask, "What was that job?" And this is the thing that surprised me. The job was really to take C++, which was a fairly static language, and show people how to write dynamic programs in a static language. That's what most of the patterns in that book were about. And in the process, patterns extended the life of C++ by a decade, which is not what I thought would happen. What I thought would happen is people, when they learned these patterns, would look at them and say, "Wow, these patterns are hard in C++ and they're easy in Smalltalk. So if I want to think in terms of these patterns, I might as well use a language where they're easily expressed." And extend the life of Smalltalk by a decade. But the opposite happened.
I think the reason why the wiki is popular is because it's the first medium that disregarded that hierarchy. And it allowed people to contribute based on their own understanding of what was valuable.
DDJ: Well let's talk about one aspect of your work where I think you will admit the results of your work greatly exceeded your expectations: the wiki. What made it so successful?
Cunningham: I think that the thing I did right there was respect the people who would come that I didn't even know, who had no right to deserve my respect because I know nothing about them. But I would say, "Come on in and I'll trust you to contribute in good faith and to make your words a gift to this community." And we did. It was magical. I tell you I felt so good everyday. For the first couple of years I was on that thing for a few hours a day. This is the original wiki, which is about the programming, and I loved it. I will say that everyday that I spent hours on that wiki, I would say to myself, "I've got to stop doing this. I've got to focus on my business. I have work to do." Thank goodness I didn't bother to do that work and fiddled with wiki instead!
DDJ: It's astonishing that wikis haven't been corrupted. They haven't been turned into garbage dumps by people who like spending time doing those kind of things. It sort of reaffirms a little of one's faith in humanity.
Cunningham: There was the invention of wiki spam, and that made it a little less fun. What's going on there is you create something of value, and once it becomes valued, people give it attention. And the weakness of wiki is that it says, "Anybody gets the same access to that attention." So the more successful you are, the harder it is to be a wiki.
But let me switch back to why I think it worked. What we really did was say was the command and control hierarchical communications that we had to use in organizations wasn't necessary anymore. In fact, it was an impediment. It wasn't that it couldn't work. It was that it was unnecessary. And I think the reason why the wiki is popular is because it's the first medium that disregarded that hierarchy. And it allowed people to contribute based on their own understanding of what was valuable. And that has grown up with an understanding in organizational theory that you have to work that way. In fact, organizations are flattening left and right, and they might even say they're becoming more wiki.
DDJ: In terms of Wikipedia, would you be an deletionist or an inclusionist?
Cunningham: Oh boy, I don't know if I have an opinion. Because those terms actually emerged on my wiki and I'm not sure I had an opinion there. But we were counting the number of pages and it was kind of a special day when we passed 20,000 pages. And then someone said, "Gee, maybe that's about the right size. We don't want to be any bigger than 20,000 pages." And I thought that was a very interesting idea. And then some people said, "Well, it's now 20,100. Let's beat that 20,100 back to 20,000." And so I saw it as an experiment. There were plenty of tiny little pages that nobody ever read. I think I even made some tools to help people find them and they went and deleted them. And other people felt that anything that's written is worth keeping, and they were insulted by that. So then it became aggressive, and judgmental and I'm having a little trouble remembering how it all worked. But I do think that we get a lot of value out of focusing our attention. But I think the whole notion of, to think about Wikipedia, the whole notion of encyclopedic sort of says everything, doesn't it? It means broad.
DDJ: Even though I tend toward the inclusionist side, sometimes when I look up somebody and I go to a disambiguation page that contains 45 entries I wonder to myself whether we need to know about a non-medal swimmer on the 1948 Olympics team.
Cunningham: I think that Wikipedia has been handling that fairly well. We could talk to people who are a little closer to the day-to-day Wikipedia and they could probably even correct me on this, but I think the more important notion is notable. The community has to agree upon what the criterion of notability is, and that's only because, there are forms of abuse that arise from non-notable people feigning notability. And that's the fight. And once you start fighting that fight, you find all kinds of stuff that doesn't pass muster that wasn't hurting anybody. And you say, well, in the sense of fairness, I've got to delete it too. And that's a tough thing.
DDJ: What about a separate wiki for non-notables?
Cunningham: That would be a good thing. I do know there's a deletipedia or something like that, with everything that's ever been deleted from Wikipedia. So if you want to go see what's been removed, there you go. My solution is, it's easy enough to set up a site, so let's let everyone have their own wiki, and let the notables surface through kind of an evolutionary process.